<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <title>Web Bluetooth</title>
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/StyleSheets/TR/2016/cg-draft" rel="stylesheet">
  <link href="https://webbluetoothcg.github.io/web-bluetooth/" rel="canonical">
<style>
  .argument-list { display: inline-block; vertical-align: top; }
  /* Show self-links for various elements. This is incompatible with nearby floats. */
  .note, .why, .example, .issue { overflow: inherit; }

  .unstable::before {
    content: "This section is not stable.";
    float: right;
    color: red;
  }
  .unstable {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='290'><text transform='rotate(-45)' text-anchor='middle' font-family='sans-serif' font-weight='bold' font-size='70' y='210' opacity='.1'>Unstable</text></svg>");
    background-repeat: repeat
  }

 .unstable.example:not(.no-marker)::before {
     content: "Example " counter(example) " (Unstable)";
     float: none;
 }

 .note {
     background-color: rgba(145, 235, 145, .2);
 }
 .example {
     background-color: rgba(240, 230, 170, .2);
 }
 .def {
     background-color: rgba(85, 170, 255, .2);
 }
 .issue {
     background-color: rgba(235, 145, 145, .2);
 }
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">Web Bluetooth</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://webbluetoothcg.github.io/web-bluetooth/">https://webbluetoothcg.github.io/web-bluetooth/</a>
     <dt class="editor">Editor:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://github.com/WebBluetoothCG/web-bluetooth/graphs/contributors">See contributors on GitHub</a>
     <dt>Translations <small>(non-normative)</small>:
     <dd><span title="Japanese"><a href="https://tkybpp.github.io/web-bluetooth-jp/" hreflang="ja" lang="ja" rel="alternate">日本語</a></span>
     <dt>Participate:
     <dd><a href="https://www.w3.org/community/web-bluetooth/">Join the W3C Community Group</a>
     <dd><a href="https://github.com/WebBluetoothCG/web-bluetooth">Fix the text through GitHub</a>
     <dd><a href="mailto:public-web-bluetooth@w3.org">public-web-bluetooth@w3.org</a> (<a href="https://lists.w3.org/Archives/Public/public-web-bluetooth/" rel="discussion">archives</a>)
     <dd><a href="irc://irc.w3.org:6665/#web-bluetooth">IRC: #web-bluetooth on W3C’s IRC</a>
     <dd>
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 the Contributors to the Web Bluetooth Specification, published by the <a href="https://www.w3.org/community/web-bluetooth/">Web Bluetooth Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>.
A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This document describes an API to discover and communicate with devices

over the Bluetooth 4 wireless standard using the Generic Attribute Profile (GATT).</p>
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This specification was published by the <a href="https://www.w3.org/community/web-bluetooth/">Web Bluetooth Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

  Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply.

  Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p>
   <p> Changes to this document may be tracked at <a href="https://github.com/WebBluetoothCG/web-bluetooth/commits/gh-pages">https://github.com/WebBluetoothCG/web-bluetooth/commits/gh-pages</a>. </p>
   <p>If you wish to make comments regarding this document, please send them to <a href="mailto:public-web-bluetooth@w3.org">public-web-bluetooth@w3.org</a> (<a href="mailto:public-web-bluetooth-request@w3.org?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-web-bluetooth/">archives</a>).</p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
     <ol class="toc">
      <li><a href="#introduction-examples"><span class="secno">1.1</span> <span class="content">Examples</span></a>
     </ol>
    <li>
     <a href="#security-and-privacy"><span class="secno">2</span> <span class="content">Security and privacy considerations</span></a>
     <ol class="toc">
      <li><a href="#device-access-is-powerful"><span class="secno">2.1</span> <span class="content">Device access is powerful</span></a>
      <li><a href="#server-takeovers"><span class="secno">2.2</span> <span class="content">Trusted servers can serve malicious code</span></a>
      <li><a href="#attacks-on-devices"><span class="secno">2.3</span> <span class="content">Attacks on devices</span></a>
      <li>
       <a href="#bluetooth-device-identifiers"><span class="secno">2.4</span> <span class="content">Bluetooth device identifiers</span></a>
       <ol class="toc">
        <li><a href="#remote-device-identifiers"><span class="secno">2.4.1</span> <span class="content">Identifiers for remote Bluetooth devices</span></a>
        <li><a href="#ua-bluetooth-address"><span class="secno">2.4.2</span> <span class="content">The UA’s Bluetooth address</span></a>
       </ol>
      <li><a href="#availability-fingerprint"><span class="secno">2.5</span> <span class="content">Exposing Bluetooth availability</span></a>
     </ol>
    <li>
     <a href="#device-discovery"><span class="secno">3</span> <span class="content">Device Discovery</span></a>
     <ol class="toc">
      <li><a href="#permission-api-integration"><span class="secno">3.1</span> <span class="content">Permission API Integration</span></a>
      <li><a href="#availability"><span class="secno">3.2</span> <span class="content">Overall Bluetooth availability</span></a>
     </ol>
    <li>
     <a href="#device-representation"><span class="secno">4</span> <span class="content">Device Representation</span></a>
     <ol class="toc">
      <li><a href="#global-device-properties"><span class="secno">4.1</span> <span class="content">Global Bluetooth device properties</span></a>
      <li>
       <a href="#bluetoothdevice"><span class="secno">4.2</span> <span class="content">BluetoothDevice</span></a>
       <ol class="toc">
        <li>
         <a href="#advertising-events"><span class="secno">4.2.1</span> <span class="content">Responding to Advertising Events</span></a>
         <ol class="toc">
          <li><a href="#bluetoothmanufacturerdatamap"><span class="secno">4.2.1.1</span> <span class="content">BluetoothManufacturerDataMap</span></a>
          <li><a href="#bluetoothservicedatamap"><span class="secno">4.2.1.2</span> <span class="content">BluetoothServiceDataMap</span></a>
         </ol>
       </ol>
     </ol>
    <li>
     <a href="#gatt-interaction"><span class="secno">5</span> <span class="content">GATT Interaction</span></a>
     <ol class="toc">
      <li>
       <a href="#information-model"><span class="secno">5.1</span> <span class="content">GATT Information Model</span></a>
       <ol class="toc">
        <li><a href="#persistence"><span class="secno">5.1.1</span> <span class="content">Persistence across connections</span></a>
        <li><a href="#bluetooth-cache"><span class="secno">5.1.2</span> <span class="content">The Bluetooth cache</span></a>
        <li><a href="#navigating-bluetooth-hierarchy"><span class="secno">5.1.3</span> <span class="content">Navigating the Bluetooth Hierarchy</span></a>
        <li><a href="#identifying-attributes"><span class="secno">5.1.4</span> <span class="content">Identifying Services, Characteristics, and Descriptors</span></a>
       </ol>
      <li><a href="#bluetoothremotegattserver"><span class="secno">5.2</span> <span class="content">BluetoothRemoteGATTServer</span></a>
      <li><a href="#bluetoothremotegattservice"><span class="secno">5.3</span> <span class="content">BluetoothRemoteGATTService</span></a>
      <li>
       <a href="#bluetoothremotegattcharacteristic"><span class="secno">5.4</span> <span class="content">BluetoothRemoteGATTCharacteristic</span></a>
       <ol class="toc">
        <li><a href="#characteristicproperties"><span class="secno">5.4.1</span> <span class="content"><span><code>BluetoothCharacteristicProperties</code></span></span></a>
       </ol>
      <li><a href="#bluetoothremotegattdescriptor"><span class="secno">5.5</span> <span class="content">BluetoothRemoteGATTDescriptor</span></a>
      <li>
       <a href="#events"><span class="secno">5.6</span> <span class="content">Events</span></a>
       <ol class="toc">
        <li><a href="#bluetooth-tree"><span class="secno">5.6.1</span> <span class="content">Bluetooth Tree</span></a>
        <li><a href="#event-types"><span class="secno">5.6.2</span> <span class="content">Event types</span></a>
        <li><a href="#disconnection-events"><span class="secno">5.6.3</span> <span class="content">Responding to Disconnection</span></a>
        <li><a href="#notification-events"><span class="secno">5.6.4</span> <span class="content">Responding to Notifications and Indications</span></a>
        <li><a href="#service-change-events"><span class="secno">5.6.5</span> <span class="content">Responding to Service Changes</span></a>
        <li><a href="#idl-event-handlers"><span class="secno">5.6.6</span> <span class="content">IDL event handlers</span></a>
       </ol>
      <li><a href="#error-handling"><span class="secno">5.7</span> <span class="content">Error handling</span></a>
     </ol>
    <li>
     <a href="#uuids"><span class="secno">6</span> <span class="content">UUIDs</span></a>
     <ol class="toc">
      <li><a href="#standardized-uuids"><span class="secno">6.1</span> <span class="content">Standardized UUIDs</span></a>
     </ol>
    <li><a href="#the-gatt-blocklist"><span class="secno">7</span> <span class="content">The GATT Blocklist</span></a>
    <li><a href="#navigator-extensions"><span class="secno">8</span> <span class="content">Extensions to the Navigator Interface</span></a>
    <li><a href="#terminology"><span class="secno">9</span> <span class="content">Terminology and Conventions</span></a>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <section>
    <h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
    <p><em>This section is non-normative.</em></p>
    <p> <a href="https://developer.bluetooth.org/">Bluetooth</a> is
    a standard for short-range wireless communication between devices.
    Bluetooth "Classic" (<abbr title="Basic Rate">BR</abbr>/<abbr title="Enhanced Data Rate">EDR</abbr>)
    defines a set of binary protocols and supports speeds up to about 24Mbps.
    Bluetooth 4.0 introduced a new "Low Energy" mode known as "Bluetooth Smart", <abbr title="Bluetooth Low Energy">BLE</abbr>, or just <abbr title="Low Energy">LE</abbr> which is limited to about 1Mbps but
    allows devices to leave their transmitters off most of the time.
    BLE provides most of its functionality through key/value pairs provided by
    the <a data-link-type="dfn" href="#generic-attribute-profile" id="ref-for-generic-attribute-profile">Generic Attribute Profile
    (<abbr title="Generic Attribute Profile">GATT</abbr>)</a>. </p>
    <p> BLE defines multiple roles that devices can play.
    The <a data-link-type="dfn" href="#broadcaster" id="ref-for-broadcaster">Broadcaster</a> and <a data-link-type="dfn" href="#observer" id="ref-for-observer">Observer</a> roles are
    for transmitter- and receiver-only applications, respectively.
    Devices acting in the <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral">Peripheral</a> role can receive connections,
    and devices acting in the <a data-link-type="dfn" href="#central" id="ref-for-central">Central</a> role can connect to <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral①">Peripheral</a> devices. </p>
    <p> A device acting in either the <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral②">Peripheral</a> or <a data-link-type="dfn" href="#central" id="ref-for-central①">Central</a> role
    can host a <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server">GATT Server</a>,
    which exposes a hierarchy of <a data-link-type="dfn" href="#service" id="ref-for-service">Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor">Descriptor</a>s.
    See <a href="#information-model">§ 5.1 GATT Information Model</a> for more details about this hierarchy.
    Despite being designed to support BLE transport,
    the GATT protocol can also run over BR/EDR transport. </p>
    <p> The first version of this specification allows web pages,
    running on a UA in the <a data-link-type="dfn" href="#central" id="ref-for-central②">Central</a> role, to connect to <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server①">GATT Server</a>s
    over either a BR/EDR or LE connection.
    While this specification cites the <a data-link-type="biblio" href="#biblio-bluetooth42">[BLUETOOTH42]</a> specification,
    it intends to also support communication
    among devices that only implement Bluetooth 4.0 or 4.1. </p>
    <section>
     <h3 class="heading settled" data-level="1.1" id="introduction-examples"><span class="secno">1.1. </span><span class="content">Examples</span><a class="self-link" href="#introduction-examples"></a></h3>
     <div class="example" id="example-heart-rate-monitor">
      <a class="self-link" href="#example-heart-rate-monitor"></a> 
      <p> To discover and retrieve data from a standard heart rate monitor,
        a website would use code like the following: </p>
<pre class="highlight"><c- a>let</c-> chosenHeartRateService <c- o>=</c-> <c- kc>null</c-><c- p>;</c->

navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice">requestDevice</a><c- p>({</c->
  filters<c- o>:</c-> <c- p>[{</c->
    services<c- o>:</c-> <c- p>[</c-><c- t>'heart_rate'</c-><c- p>],</c->
  <c- p>}]</c->
<c- p>}).</c->then<c- p>(</c->device <c- p>=></c-> device<c- p>.</c->gatt<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect">connect<c- p>()</c-></a><c- p>)</c->
<c- p>.</c->then<c- p>(</c->server <c- p>=></c-> server<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattserver-getprimaryservice" id="ref-for-dom-bluetoothremotegattserver-getprimaryservice">getPrimaryService</a><c- p>(</c-><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml#" id="termref-for-"><c- t>'heart_rate'</c-></a><c- p>))</c->
<c- p>.</c->then<c- p>(</c->service <c- p>=></c-> <c- p>{</c->
  chosenHeartRateService <c- o>=</c-> service<c- p>;</c->
  <c- k>return</c-> Promise<c- p>.</c->all<c- p>([</c->
    service<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml#" id="termref-for-①"><c- t>'body_sensor_location'</c-></a><c- p>)</c->
      <c- p>.</c->then<c- p>(</c->handleBodySensorLocationCharacteristic<c- p>),</c->
    service<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic①">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml#" id="termref-for-②"><c- t>'heart_rate_measurement'</c-></a><c- p>)</c->
      <c- p>.</c->then<c- p>(</c->handleHeartRateMeasurementCharacteristic<c- p>),</c->
  <c- p>]);</c->
<c- p>});</c->

<c- a>function</c-> handleBodySensorLocationCharacteristic<c- p>(</c->characteristic<c- p>)</c-> <c- p>{</c->
  <c- k>if</c-> <c- p>(</c->characteristic <c- o>===</c-> <c- kc>null</c-><c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>(</c-><c- u>"Unknown sensor location."</c-><c- p>);</c->
    <c- k>return</c-> Promise<c- p>.</c->resolve<c- p>();</c->
  <c- p>}</c->
  <c- k>return</c-> characteristic<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue">readValue<c- p>()</c-></a>
  <c- p>.</c->then<c- p>(</c->sensorLocationData <c- p>=></c-> <c- p>{</c->
    <c- kr>const</c-> sensorLocation <c- o>=</c-> sensorLocationData<c- p>.</c->getUint8<c- p>(</c-><c- mi>0</c-><c- p>);</c->
    <c- k>switch</c-> <c- p>(</c->sensorLocation<c- p>)</c-> <c- p>{</c->
      <c- k>case</c-> <c- mi>0</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Other'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>1</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Chest'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>2</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Wrist'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>3</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Finger'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>4</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Hand'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>5</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Ear Lobe'</c-><c- p>;</c->
      <c- k>case</c-> <c- mi>6</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Foot'</c-><c- p>;</c->
      <c- k>default</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Unknown'</c-><c- p>;</c->
    <c- p>}</c->
  <c- p>}).</c->then<c- p>(</c->location <c- p>=></c-> console<c- p>.</c->log<c- p>(</c->location<c- p>));</c->
<c- p>}</c->

<c- a>function</c-> handleHeartRateMeasurementCharacteristic<c- p>(</c->characteristic<c- p>)</c-> <c- p>{</c->
  <c- k>return</c-> characteristic<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications">startNotifications<c- p>()</c-></a>
  <c- p>.</c->then<c- p>(</c-><c- kr>char</c-> <c- p>=></c-> <c- p>{</c->
    characteristic<c- p>.</c->addEventListener<c- p>(</c-><c- t>'</c-><a class="idl-code" data-link-type="event" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged"><c- t>characteristicvaluechanged</c-></a><c- t>'</c-><c- p>,</c->
                                    onHeartRateChanged<c- p>);</c->
  <c- p>});</c->
<c- p>}</c->

<c- a>function</c-> onHeartRateChanged<c- p>(</c->event<c- p>)</c-> <c- p>{</c->
  <c- kr>const</c-> characteristic <c- o>=</c-> event<c- p>.</c->target<c- p>;</c->
  console<c- p>.</c->log<c- p>(</c->parseHeartRate<c- p>(</c->characteristic<c- p>.</c-><a class="idl-code" data-link-type="attribute" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value">value</a><c- p>));</c->
<c- p>}</c->
</pre>
      <p> <code>parseHeartRate()</code> would be defined using the <a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml#" id="termref-for-③"> <code>heart_rate_measurement</code> documentation</a> to read the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor">DataView</a></code> stored
        in a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic">BluetoothRemoteGATTCharacteristic</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value①">value</a></code> field. </p>
<pre class="highlight"><c- a>function</c-> parseHeartRate<c- p>(</c->data<c- p>)</c-> <c- p>{</c->
  <c- kr>const</c-> flags <c- o>=</c-> data<c- p>.</c->getUint8<c- p>(</c-><c- mi>0</c-><c- p>);</c->
  <c- kr>const</c-> rate16Bits <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x1</c-><c- p>;</c->
  <c- kr>const</c-> result <c- o>=</c-> <c- p>{};</c->
  <c- a>let</c-> index <c- o>=</c-> <c- mi>1</c-><c- p>;</c->
  <c- k>if</c-> <c- p>(</c->rate16Bits<c- p>)</c-> <c- p>{</c->
    result<c- p>.</c->heartRate <c- o>=</c-> data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>);</c->
    index <c- o>+=</c-> <c- mi>2</c-><c- p>;</c->
  <c- p>}</c-> <c- k>else</c-> <c- p>{</c->
    result<c- p>.</c->heartRate <c- o>=</c-> data<c- p>.</c->getUint8<c- p>(</c->index<c- p>);</c->
    index <c- o>+=</c-> <c- mi>1</c-><c- p>;</c->
  <c- p>}</c->
  <c- kr>const</c-> contactDetected <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x2</c-><c- p>;</c->
  <c- kr>const</c-> contactSensorPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x4</c-><c- p>;</c->
  <c- k>if</c-> <c- p>(</c->contactSensorPresent<c- p>)</c-> <c- p>{</c->
    result<c- p>.</c->contactDetected <c- o>=</c-> <c- o>!!</c->contactDetected<c- p>;</c->
  <c- p>}</c->
  <c- kr>const</c-> energyPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x8</c-><c- p>;</c->
  <c- k>if</c-> <c- p>(</c->energyPresent<c- p>)</c-> <c- p>{</c->
    result<c- p>.</c->energyExpended <c- o>=</c-> data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>);</c->
    index <c- o>+=</c-> <c- mi>2</c-><c- p>;</c->
  <c- p>}</c->
  <c- kr>const</c-> rrIntervalPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x10</c-><c- p>;</c->
  <c- k>if</c-> <c- p>(</c->rrIntervalPresent<c- p>)</c-> <c- p>{</c->
    <c- kr>const</c-> rrIntervals <c- o>=</c-> <c- p>[];</c->
    <c- k>for</c-> <c- p>(;</c-> index <c- o>+</c-> <c- mi>1</c-> <c- o>&lt;</c-> data<c- p>.</c->byteLength<c- p>;</c-> index <c- o>+=</c-> <c- mi>2</c-><c- p>)</c-> <c- p>{</c->
      rrIntervals<c- p>.</c->push<c- p>(</c->data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>));</c->
    <c- p>}</c->
    result<c- p>.</c->rrIntervals <c- o>=</c-> rrIntervals<c- p>;</c->
  <c- p>}</c->
  <c- k>return</c-> result<c- p>;</c->
<c- p>}</c->
</pre>
      <p> <code>onHeartRateChanged()</code> might log an object like </p>
<pre class="highlight"><c- p>{</c->
  heartRate<c- o>:</c-> <c- mi>70</c-><c- p>,</c->
  contactDetected<c- o>:</c-> <c- kc>true</c-><c- p>,</c->
  energyExpended<c- o>:</c-> <c- mi>750</c-><c- p>,</c->     <c- c1>// Meaning 750kJ.</c->
  rrIntervals<c- o>:</c-> <c- p>[</c-><c- mi>890</c-><c- p>,</c-> <c- mi>870</c-><c- p>]</c->  <c- c1>// Meaning .87s and .85s.</c->
<c- p>}</c->
</pre>
      <p> If the heart rate sensor reports the <code>energyExpended</code> field,
        the web application can reset its value to <code>0</code> by writing to the <code class="idl"><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_control_point.xml#" id="termref-for-④">heart_rate_control_point</a></code> characteristic: </p>
<pre class="highlight"><c- a>function</c-> resetEnergyExpended<c- p>()</c-> <c- p>{</c->
  <c- k>if</c-> <c- p>(</c-><c- o>!</c->chosenHeartRateService<c- p>)</c-> <c- p>{</c->
    <c- k>return</c-> Promise<c- p>.</c->reject<c- p>(</c-><c- k>new</c-> Error<c- p>(</c-><c- t>'No heart rate sensor selected yet.'</c-><c- p>));</c->
  <c- p>}</c->
  <c- k>return</c-> chosenHeartRateService<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic②">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_control_point.xml#" id="termref-for-⑤"><c- t>'heart_rate_control_point'</c-></a><c- p>)</c->
  <c- p>.</c->then<c- p>(</c->controlPoint <c- p>=></c-> <c- p>{</c->
    <c- kr>const</c-> resetEnergyExpended <c- o>=</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mi>1</c-><c- p>]);</c->
    <c- k>return</c-> controlPoint<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-writevalue" id="ref-for-dom-bluetoothremotegattcharacteristic-writevalue">writeValue</a><c- p>(</c->resetEnergyExpended<c- p>);</c->
  <c- p>});</c->
<c- p>}</c->
</pre>
     </div>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="2" id="security-and-privacy"><span class="secno">2. </span><span class="content">Security and privacy considerations</span><a class="self-link" href="#security-and-privacy"></a></h2>
    <section>
     <h3 class="heading settled" data-level="2.1" id="device-access-is-powerful"><span class="secno">2.1. </span><span class="content">Device access is powerful</span><a class="self-link" href="#device-access-is-powerful"></a></h3>
     <p> When a website requests access to devices using <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice①">requestDevice()</a></code>,
      it gets the ability to access all GATT services mentioned in the call.
      The UA MUST inform the user what capabilities these services give the website
      before asking which devices to entrust to it.
      If any services in the list aren’t known to the UA,
      the UA MUST assume they give the site complete control over the device
      and inform the user of this risk.
      The UA MUST also allow the user to inspect what sites have access to what devices
      and <a data-link-type="dfn" href="#revoke-bluetooth-access" id="ref-for-revoke-bluetooth-access">revoke</a> these pairings. </p>
     <p> The UA MUST NOT allow the user to pair entire classes of devices with a website.
      It is possible to construct a class of devices
      for which each individual device sends the same Bluetooth-level identifying information.
      UAs are not required to attempt to detect this sort of forgery
      and MAY let a user pair this pseudo-device with a website. </p>
     <p> To help ensure that only the entity the user approved for access actually
      has access, this specification requires that only <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts" id="ref-for-secure-contexts">secure contexts</a> can access Bluetooth devices. </p>
    </section>
    <section class="non-normative">
     <h3 class="heading settled" data-level="2.2" id="server-takeovers"><span class="secno">2.2. </span><span class="content">Trusted servers can serve malicious code</span><a class="self-link" href="#server-takeovers"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p> Even if the user trusts an origin,
      that origin’s servers or developers could be compromised,
      or the origin’s site could be vulnerable to XSS attacks.
      Either could lead to users granting malicious code access to valuable devices.
      Origins should define a Content Security Policy (<a data-link-type="biblio" href="#biblio-csp3">[CSP3]</a>)
      to reduce the risk of XSS attacks,
      but this doesn’t help with compromised servers or developers. </p>
     <p> The ability to retrieve granted devices after a page reload,
      provided by <a href="#permission-api-integration">§ 3.1 Permission API Integration</a>,
      makes this risk worse.
      Instead of having to get the user to grant access while the site is compromised,
      the attacker can take advantage of previously-granted devices
      if the user simply visits while the site is compromised.
      On the other hand, when sites can keep access to devices across page reloads,
      they don’t have to show as many permission prompts overall,
      making it more likely that users will pay attention to the prompts they do see. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.3" id="attacks-on-devices"><span class="secno">2.3. </span><span class="content">Attacks on devices</span><a class="self-link" href="#attacks-on-devices"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p> Communication from websites can break the security model of some devices,
      which assume they only receive messages from
      the trusted operating system of a remote device.
      Human Interface Devices are a prominent example,
      where allowing a website to communicate would allow that site to log keystrokes.
      This specification includes a <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist">GATT blocklist</a> of
      such vulnerable services, characteristics, and descriptors
      to prevent websites from taking advantage of them. </p>
     <p> We expect that many devices are vulnerable to unexpected data delivered to their radio.
      In the past, these devices had to be exploited one-by-one,
      but this API makes it plausible to conduct large-scale attacks.
      This specification takes several approaches to make such attacks more difficult: </p>
     <ul>
      <li> Pairing individual devices instead of device classes
        requires at least a user action before a device can be exploited. 
      <li>
        Constraining access to <a data-link-type="dfn" href="#generic-attribute-profile" id="ref-for-generic-attribute-profile①">GATT</a>, as opposed to generic byte-stream access,
        denies malicious websites access to most parsers on the device. 
       <p> On the other hand,
          GATT’s <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①">Characteristic</a> and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor①">Descriptor</a> values are still byte arrays,
          which may be set to lengths and formats the device doesn’t expect.
          UAs are encouraged to validate these values when they can. </p>
      <li> This API never exposes Bluetooth addressing, data signing or encryption keys
        (<a data-link-type="dfn" href="#definition-of-keys-and-values" id="ref-for-definition-of-keys-and-values">Definition of Keys and Values</a>) to websites.
        This makes it more difficult for a website to predict the bits that will be sent over the radio,
        which blocks <a href="https://www.usenix.org/legacy/events/woot11/tech/final_files/Goodspeed.pdf">packet-in-packet injection attacks</a>.
        Unfortunately, this only works over encrypted links,
        which not all BLE devices are required to support. 
     </ul>
     <p> UAs can also take further steps to protect their users: </p>
     <ul>
      <li> A web service may collect lists of malicious websites and vulnerable devices.
        UAs can deny malicious websites access to any device
        and any website access to vulnerable devices. 
     </ul>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.4" id="bluetooth-device-identifiers"><span class="secno">2.4. </span><span class="content">Bluetooth device identifiers</span><a class="self-link" href="#bluetooth-device-identifiers"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p> Each Bluetooth BR/EDR device has a unique 48-bit MAC address
      known as the <a data-link-type="dfn" href="#bd_addr" id="ref-for-bd_addr">BD_ADDR</a>.
      Each Bluetooth LE device has at least one of a <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address">Public Device Address</a> and a <a data-link-type="dfn" href="#static-device-address" id="ref-for-static-device-address">Static Device Address</a>.
      The <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address①">Public Device Address</a> is a MAC address.
      The <a data-link-type="dfn" href="#static-device-address" id="ref-for-static-device-address①">Static Device Address</a> may be regenerated on each restart.
      A BR/EDR/LE device will use the same value
      for the <a data-link-type="dfn" href="#bd_addr" id="ref-for-bd_addr①">BD_ADDR</a> and the <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address②">Public Device Address</a> (specified in the <a data-link-type="dfn" href="#read-bd_addr-command" id="ref-for-read-bd_addr-command">Read BD_ADDR Command</a>). </p>
     <p> An LE device may also have a unique, 128-bit <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key">Identity Resolving Key</a>,
      which is sent to trusted devices during the bonding process.
      To avoid leaking a persistent identifier, an LE device may scan and advertise using
      a random Resolvable or Non-Resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address">Private Address</a> instead of its Static or Public Address.
      These are regenerated periodically (approximately every 15 minutes),
      but a bonded device can check whether one of its stored <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key①">IRK</a>s matches
      any given Resolvable Private Address
      using the <a data-link-type="dfn" href="#resolvable-private-address-resolution-procedure" id="ref-for-resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</a>. </p>
     <p> Each Bluetooth device also has a human-readable <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name">Bluetooth Device Name</a>.
      These aren’t guaranteed to be unique, but may well be, depending on the device type. </p>
     <section>
      <h4 class="heading settled" data-level="2.4.1" id="remote-device-identifiers"><span class="secno">2.4.1. </span><span class="content">Identifiers for remote Bluetooth devices</span><a class="self-link" href="#remote-device-identifiers"></a></h4>
      <p><em>This section is non-normative.</em></p>
      <p> If a website can retrieve any of the persistent device IDs,
        these can be used, in combination with a large effort to catalog ambient devices,
        to discover a user’s location.
        A device ID can also be used to identify that a user who
        pairs two different websites with the same Bluetooth device
        is a single user.
        On the other hand, many GATT services are available
        that could be used to fingerprint a device,
        and a device can easily expose a custom GATT service to make this easier. </p>
      <p> This specification <a href="#note-device-id-tracking">suggests</a> that
        the UA use different device IDs for a single device
        when its user doesn’t intend scripts to learn that it’s a single device,
        which makes it difficult for websites to abuse the device address like this.
        Device makers can still design their devices to help track users,
        but it takes work. </p>
     </section>
     <section>
      <h4 class="heading settled" data-level="2.4.2" id="ua-bluetooth-address"><span class="secno">2.4.2. </span><span class="content">The UA’s Bluetooth address</span><a class="self-link" href="#ua-bluetooth-address"></a></h4>
      <p><em>This section is non-normative.</em></p>
      <p> In BR/EDR mode, or in LE mode during active scanning without the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature">Privacy Feature</a>,
        the UA broadcasts its persistent ID to any nearby Bluetooth radio.
        This makes it easy to scatter hostile devices in an area and track the UA.
        As of 2014-08, few or no platforms document that they implement the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature①">Privacy Feature</a>,
        so despite this spec recommending it, few UAs are likely to use it.
        This spec does <a href="#requestDevice-user-gesture">require a user gesture</a> for a website to trigger a scan, which reduces the frequency of scans some,
        but it would still be better for more platforms to expose the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature②">Privacy Feature</a>. </p>
     </section>
    </section>
    <section class="non-normative">
     <h3 class="heading settled" data-level="2.5" id="availability-fingerprint"><span class="secno">2.5. </span><span class="content">Exposing Bluetooth availability</span><a class="self-link" href="#availability-fingerprint"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p> <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability">getAvailability()</a></code></code> exposes whether a Bluetooth radio is available on the user’s system,
      regardless of whether it is powered on or not. The availability is also
      affected if the user has configured the UA to block Web Bluetooth.
      Some users might consider this private,
      although it’s hard to imagine the damage that would result from revealing it.
      This information also increases the UA’s <a data-link-type="dfn" href="https://w3c.github.io/fingerprinting-guidance/#dfn-fingerprinting-surface" id="ref-for-dfn-fingerprinting-surface">fingerprinting surface</a> by a bit.
      This function returns a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects">Promise</a></code>,
      so UAs have the option of asking the user what value they want to return,
      but we expect the increased risk to be small enough that
      UAs will choose not to prompt. </p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="3" id="device-discovery"><span class="secno">3. </span><span class="content">Device Discovery</span><span id="requestDevice-secure-context"></span><a class="self-link" href="#device-discovery"></a></h2>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothdatafilterinit"><code><c- g>BluetoothDataFilterInit</c-></code></dfn> {
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource"><c- n>BufferSource</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dict-member" data-export data-type="BufferSource " id="dom-bluetoothdatafilterinit-dataprefix"><code><c- g>dataPrefix</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource①"><c- n>BufferSource</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dict-member" data-export data-type="BufferSource " id="dom-bluetoothdatafilterinit-mask"><code><c- g>mask</c-></code></dfn>;
};
<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothlescanfilterinit"><code><c- g>BluetoothLEScanFilterInit</c-></code></dfn> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services"><c- g>services</c-></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name"><c- g>name</c-></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix"><c- g>namePrefix</c-></a>;
  // Maps unsigned shorts to BluetoothDataFilters.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object"><c- b>object</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="object " href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata"><c- g>manufacturerData</c-></a>;
  // Maps BluetoothServiceUUIDs to BluetoothDataFilters.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①"><c- b>object</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="object " href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata"><c- g>serviceData</c-></a>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-requestdeviceoptions"><code><c- g>RequestDeviceOptions</c-></code></dfn> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters"><c- g>filters</c-></a>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid①"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices"><c- g>optionalServices</c-></a> = [];
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-default="false" data-link-type="dict-member" data-type="boolean " href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices"><c- g>acceptAllDevices</c-></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetooth"><code><c- g>Bluetooth</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability①"><c- g>getAvailability</c-></a>();
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <dfn class="idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-bluetooth-onavailabilitychanged"><code><c- g>onavailabilitychanged</c-></code><a class="self-link" href="#dom-bluetooth-onavailabilitychanged"></a></dfn>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice"><c- n>BluetoothDevice</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice?" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice"><c- g>referringDevice</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①"><c- n>BluetoothDevice</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice②"><c- g>requestDevice</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-requestdeviceoptions" id="ref-for-dictdef-requestdeviceoptions"><c- n>RequestDeviceOptions</c-></a> <dfn class="idl-code" data-dfn-for="Bluetooth/requestDevice(options), Bluetooth/requestDevice()" data-dfn-type="argument" data-export id="dom-bluetooth-requestdevice-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-bluetooth-requestdevice-options-options"></a></dfn> = {});
};
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers"><c- n>BluetoothDeviceEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth②"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers"><c- n>ServiceEventHandlers</c-></a>;
</pre>
    <div class="note no-marker" role="note">
     <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth③">Bluetooth</a></code> members</div>
     <p> <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability②">getAvailability()</a></code> informs the page
      whether Bluetooth is available at all.
      An adapter that’s disabled through software should count as available.
      Changes in availability,
      for example when the user physically attaches or detaches an adapter,
      are reported through the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged">availabilitychanged</a></code> event. </p>
     <p class="unstable"> <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice①">referringDevice</a></code> gives access to
      the device from which the user opened this page, if any.
      For example, an <a href="https://developers.google.com/beacons/eddystone">Eddystone</a> beacon
      might advertise a URL, which the UA allows the user to open.
      A <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②">BluetoothDevice</a></code> representing the beacon would be available
      through <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice②">referringDevice</a></code></code>. </p>
     <p> <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice③">requestDevice(options)</a></code> asks the user
      to grant this origin access to a device
      that <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter">matches any filter</a> in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-filters"><code>filters</code></dfn></code>.
      To <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter①">match a filter</a>, the device has to: </p>
     <ul>
      <li> support <em>all</em> the GATT service UUIDs
        in the <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-services"><code>services</code></dfn> list
        if that member is present, 
      <li> have a name equal to <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-name"><code>name</code></dfn> if that member is present, 
      <li> have a name starting with <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-nameprefix"><code>namePrefix</code></dfn> if that member is present, 
      <li class="unstable"> advertise <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data">manufacturer specific data</a> matching all of the key/value pairs in <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-manufacturerdata"><code>manufacturerData</code></dfn> if that member is present, and 
      <li class="unstable"> advertise <a data-link-type="dfn" href="#service-data" id="ref-for-service-data">service data</a> matching all of the key/value pairs in <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-servicedata"><code>serviceData</code></dfn> if that member is present. 
     </ul>
     <p class="unstable" data-link-for-hint="BluetoothDataFilterInit"> Both <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data①">Manufacturer Specific Data</a> and <a data-link-type="dfn" href="#service-data" id="ref-for-service-data①">Service Data</a> map a key to an array of bytes. <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit">BluetoothDataFilterInit</a></code> filters these arrays.
      An array matches if it has a <var>prefix</var> such that <code><var>prefix</var> &amp; <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask">mask</a></code></code> is equal to <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix">dataPrefix</a></code> &amp; <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask①">mask</a></code></code>. </p>
     <p> Note that
      if a device changes its behavior significantly when it connects,
      for example by not advertising its identifying manufacturer data anymore
      and instead having the client discover some identifying GATT services,
      the website may need to include filters for both behaviors. </p>
     <p> In rare cases,
      a device may not advertise enough distinguishing information
      to let a site filter out uninteresting devices.
      In those cases, a site can set <dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-acceptalldevices"><code>acceptAllDevices</code></dfn> to <code>true</code> and omit all <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters①">filters</a></code>.
      This puts the burden of selecting the right device entirely on the site’s users.
      If a site uses <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices①">acceptAllDevices</a></code>,
      it will only be able to use services listed in <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices①">optionalServices</a></code>. </p>
     <p> After the user selects a device to pair with this origin,
      the origin is allowed to access any service whose UUID was listed
      in the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services①">services</a></code> list
      in any element of <code>options.filters</code> or in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-optionalservices"><code>optionalServices</code></dfn></code>. </p>
     <p> This implies that if developers filter just by name,
      they must use <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices②">optionalServices</a></code> to get access to any services. </p>
    </div>
    <div class="example" id="example-filter-by-services">
     <a class="self-link" href="#example-filter-by-services"></a> 
     <p> Say the UA is close to the following devices: </p>
     <table class="data">
      <thead>
       <tr>
        <th>Device
        <th>Advertised Services
      <tbody>
       <tr>
        <td>D1
        <td>A, B, C, D
       <tr>
        <td>D2
        <td>A, B, E
       <tr>
        <td>D3
        <td>C, D
       <tr>
        <td>D4
        <td>E
       <tr>
        <td>D5
        <td><i>&lt;none></i>
     </table>
     <p> If the website calls </p>
<pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c->
  filters<c- o>:</c-> <c- p>[</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]}</c-> <c- p>]</c->
<c- p>});</c->
</pre>
     <p> the user will be shown a dialog containing devices D1 and D2.
      If the user selects D1, the website will not be able to access services C or D.
      If the user selects D2, the website will not be able to access service E. </p>
     <p> On the other hand, if the website calls </p>
<pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c->
  filters<c- o>:</c-> <c- p>[</c->
    <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]},</c->
    <c- p>{</c->services<c- o>:</c-> <c- p>[</c->C<c- p>,</c-> D<c- p>]}</c->
  <c- p>]</c->
<c- p>});</c->
</pre>
     <p> the dialog will contain devices D1, D2, and D3,
      and if the user selects D1,
      the website will be able to access services A, B, C, and D. </p>
     <p> The <code>optionalServices</code> list doesn’t add any devices
      to the dialog the user sees,
      but it does affect which services the website can use from the device the user picks. </p>
<pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c->
  filters<c- o>:</c-> <c- p>[</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]}</c-> <c- p>],</c->
  optionalServices<c- o>:</c-> <c- p>[</c->E<c- p>]</c->
<c- p>});</c->
</pre>
     <p> Shows a dialog containing D1 and D2,
      but not D4, since D4 doesn’t contain the required services.
      If the user selects D2, unlike in the first example,
      the website will be able to access services A, B, and E. </p>
     <p> The allowed services also apply if the device changes after the user grants access.
      For example, if the user selects D1 in the previous <code>requestDevice()</code> call,
      and D1 later adds a new E service,
      that will fire the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded">serviceadded</a></code> event,
      and the web page will be able to access service E. </p>
    </div>
    <div class="example" id="example-filter-by-name">
     <a class="self-link" href="#example-filter-by-name"></a> 
     <p> Say the devices in the <a href="#example-filter-by-services">previous example</a> also advertise names as follows: </p>
     <table class="data">
      <thead>
       <tr>
        <th>Device
        <th>Advertised Device Name
      <tbody>
       <tr>
        <td>D1
        <td>First De…
       <tr>
        <td>D2
        <td><i>&lt;none></i>
       <tr>
        <td>D3
        <td>Device Third
       <tr>
        <td>D4
        <td>Device Fourth
       <tr>
        <td>D5
        <td>Unique Name
     </table>
     <p> The following table shows which devices the user can select between
      for several values of <var>filters</var> passed to <code>navigator.bluetooth.requestDevice({filters: <var>filters</var>})</code>. </p>
     <table class="data">
      <thead>
       <tr>
        <th><var>filters</var>
        <th>Devices
        <th>Notes
      <tbody>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c->
</pre>
        <td>D5
        <td>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>}]</c->
</pre>
        <td>D3, D4
        <td>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->name<c- o>:</c-> <c- u>"First De"</c-><c- p>},</c->
 <c- p>{</c->name<c- o>:</c-> <c- u>"First Device"</c-><c- p>}]</c->
</pre>
        <td><i>&lt;none></i>
        <td> D1 only advertises a prefix of its name,
          so trying to match its whole name fails. 
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"First"</c-><c- p>},</c->
 <c- p>{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c->
</pre>
        <td>D1, D5
        <td>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->services<c- o>:</c-> <c- p>[</c->C<c- p>],</c->
  namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>},</c->
 <c- p>{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c->
</pre>
        <td>D3, D5
        <td>
     </table>
    </div>
    <div class="example unstable" id="example-filter-by-manufacturer-service-data">
     <a class="self-link" href="#example-filter-by-manufacturer-service-data"></a> 
     <p> Say the devices in the <a href="#example-filter-by-services">previous example</a> also advertise manufacturer or service data as follows: </p>
     <table class="data">
      <thead>
       <tr>
        <th>Device
        <th>Manufacturer Data
        <th>Service Data
      <tbody>
       <tr>
        <td>D1
        <td>17: 01 02 03
        <td>
       <tr>
        <td>D2
        <td>
        <td>A: 01 02 03
     </table>
     <p> The following table shows which devices the user can select between
      for several values of <var>filters</var> passed to <code>navigator.bluetooth.requestDevice({filters: <var>filters</var>})</code>. </p>
     <table class="data">
      <thead>
       <tr>
        <th><var>filters</var>
        <th>Devices
      <tbody>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c-><c- mi>17</c-><c- o>:</c-> <c- p>{}}}]</c->
</pre>
        <td>D1
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->serviceData<c- o>:</c-> <c- p>{</c-><c- u>"A"</c-><c- o>:</c-> <c- p>{}}}]</c->
</pre>
        <td>D2
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c-><c- mi>17</c-><c- o>:</c-> <c- p>{}}},</c->
 <c- p>{</c->serviceData<c- o>:</c-> <c- p>{</c-><c- u>"A"</c-><c- o>:</c-> <c- p>{}}}]</c->
</pre>
        <td>D1, D2
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c-><c- mi>17</c-><c- o>:</c-> <c- p>{}},</c->
  serviceData<c- o>:</c-> <c- p>{</c-><c- u>"A"</c-><c- o>:</c-> <c- p>{}}}]</c->
</pre>
        <td><i>&lt;none></i>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c->
   <c- mi>17</c-><c- o>:</c-> <c- p>{</c->dataPrefix<c- o>:</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mi>1</c-><c- p>,</c-> <c- mi>2</c-><c- p>,</c-> <c- mi>3</c-><c- p>])},</c->
<c- p>}}]</c->
</pre>
        <td>D1
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c->
   <c- mi>17</c-><c- o>:</c-> <c- p>{</c->dataPrefix<c- o>:</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mi>1</c-><c- p>,</c-> <c- mi>2</c-><c- p>,</c-> <c- mi>3</c-><c- p>,</c-> <c- mi>4</c-><c- p>])},</c->
<c- p>}}]</c->
</pre>
        <td><i>&lt;none></i>
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c->
   <c- mi>17</c-><c- o>:</c-> <c- p>{</c->dataPrefix<c- o>:</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mi>1</c-><c- p>])},</c->
<c- p>}}]</c->
</pre>
        <td>D1
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c->
   <c- mi>17</c-><c- o>:</c-> <c- p>{</c->dataPrefix<c- o>:</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mh>0x91</c-><c- p>,</c-> <c- mh>0xAA</c-><c- p>]),</c->
        mask<c- o>:</c-> <c- k>new</c-> Uint8Array<c- p>([</c-><c- mh>0x0F</c-><c- p>,</c-> <c- mh>0x57</c-><c- p>])},</c->
<c- p>}}]</c->
</pre>
        <td>D1
       <tr>
        <td>
<pre class="highlight"><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{</c->
   <c- mi>17</c-><c- o>:</c-> <c- p>{},</c->
   <c- mi>18</c-><c- o>:</c-> <c- p>{},</c->
<c- p>}}]</c->
</pre>
        <td><i>&lt;none></i>
     </table>
    </div>
    <div class="example" data-link-for-hint="RequestDeviceOptions" id="example-disallowed-filters">
     <a class="self-link" href="#example-disallowed-filters"></a> 
     <p> Filters that either accept or reject all possible devices cause <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror">TypeError</a></code>s.
      To accept all devices, use <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices②">acceptAllDevices</a></code> instead. </p>
     <table class="data">
      <thead>
       <tr>
        <th>Call
        <th>Notes
      <tbody>
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({})</c->
</pre>
        <td>Invalid: An absent list of filters doesn’t accept any devices.
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->filters<c- o>:</c-><c- p>[]})</c->
</pre>
        <td>Invalid: An empty list of filters doesn’t accept any devices.
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->filters<c- o>:</c-><c- p>[{}]})</c->
</pre>
        <td>Invalid: An empty filter accepts all devices, and so isn’t allowed either.
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->
  acceptAllDevices<c- o>:</c-><c- kc>true</c->
<c- p>})</c->
</pre>
        <td> Valid: Explicitly accept all devices with <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices③">acceptAllDevices</a></code>. 
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->
  filters<c- o>:</c-> <c- p>[...],</c->
  acceptAllDevices<c- o>:</c-><c- kc>true</c->
<c- p>})</c->
</pre>
        <td>Invalid: <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices④">acceptAllDevices</a></code> would override any <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters②">filters</a></code>.
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->
  filters<c- o>:</c-><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>""</c-><c- p>}]</c->
<c- p>})</c->
</pre>
        <td>Invalid: <code>namePrefix</code>, if present, must be non-empty to filter devices.
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->
  filters<c- o>:</c-><c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>{}}]</c->
<c- p>})</c->
</pre>
        <td> Invalid: <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata①">manufacturerData</a></code>, if present,
          must be non-empty to filter devices. 
       <tr>
        <td>
<pre class="highlight">requestDevice<c- p>({</c->
  filters<c- o>:</c-><c- p>[{</c->serviceData<c- o>:</c-> <c- p>{}}]</c->
<c- p>})</c->
</pre>
        <td> Invalid: <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata①">serviceData</a></code>, if present,
          must be non-empty to filter devices. 
     </table>
    </div>
    <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth④">Bluetooth</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots">internal slots</a> described in the following table: </p>
    <table class="data">
     <thead>
      <tr>
       <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①">Internal Slot</a>
       <th>Initial Value
       <th>Description (non-normative)
     <tbody>
      <tr>
       <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-deviceinstancemap-slot"><code>[[deviceInstanceMap]]</code></dfn>
       <td> An empty map from <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device">Bluetooth device</a>s
        to <code><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③">BluetoothDevice</a></code></code> instances. 
       <td> Ensures only one <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④">BluetoothDevice</a></code> instance represents each <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①">Bluetooth device</a> inside a single global object. 
      <tr>
       <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-attributeinstancemap-slot"><code>[[attributeInstanceMap]]</code></dfn>
       <td> An empty map from <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache">Bluetooth cache</a> entries to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects①">Promise</a></code>s. 
       <td> The <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects②">Promise</a></code>s resolve to either <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①">BluetoothRemoteGATTCharacteristic</a></code>, or <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor">BluetoothRemoteGATTDescriptor</a></code> instances. 
      <tr>
       <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-referringdevice-slot"><code>[[referringDevice]]</code></dfn>
       <td> <code>null</code> 
       <td> Set to a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑤">BluetoothDevice</a></code> while <a data-link-type="dfn" href="https://html.spec.whatwg.org/#initialise-the-document-object" id="ref-for-initialise-the-document-object">initializing the <code>Document</code> object</a> if the <code>Document</code> was opened from the device. 
    </table>
    <div class="unstable">
     <p> Getting <code>navigator.bluetooth.<dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-referringdevice"><code>referringDevice</code></dfn></code> must return <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice-slot" id="ref-for-dom-bluetooth-referringdevice-slot">[[referringDevice]]</a></code>. </p>
     <div class="algorithm" data-algorithm="initializing referringDevice">
      <p> Some UAs may allow the user
      to cause a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context">browsing context</a> to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate">navigate</a> in response to a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②">Bluetooth device</a>. <span class="note"> For example, if an <a href="https://developers.google.com/beacons/eddystone">Eddystone</a> beacon
        advertises a URL,
        the UA may allow the user to navigate to this URL. </span> If this happens, then as part of <a data-link-type="dfn" href="https://html.spec.whatwg.org/#initialise-the-document-object" id="ref-for-initialise-the-document-object①">initializing the <code>Document</code> object</a>,
      the UA MUST run the following steps: </p>
      <ol>
       <li> Let <var>referringDevice</var> be the device that caused the navigation. 
       <li> <a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing">Get the <code>BluetoothDevice</code> representing</a> <var>referringDevice</var> inside <code>navigator.bluetooth</code>,
        and let <var>referringDeviceObj</var> be the result. 
       <li>
         If the previous step threw an exception, abort these steps. 
        <p class="note" role="note"><span>Note:</span> This means the UA didn’t infer that the user intended to
        grant the current <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms">realm</a> access to <var>referringDevice</var>.
        For example, the user might have denied GATT access globally.</p>
       <li> Set <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice-slot" id="ref-for-dom-bluetooth-referringdevice-slot①">[[referringDevice]]</a></code></code> to <var>referringDeviceObj</var>. 
      </ol>
     </div>
    </div>
    <div class="algorithm" data-algorithm="matches a filter">
     <p> A <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device③">Bluetooth device</a> <var>device</var> <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="match a filter|matches any filter" data-noexport id="matches-a-filter">matches a filter</dfn> <var>filter</var> if the following steps return <code>match</code>: </p>
     <ol data-link-for-hint="BluetoothLEScanFilterInit">
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name①">name</a></code></code> is present then,
        if <var>device</var>’s <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name①">Bluetooth Device Name</a> isn’t complete
        and equal to <code><var>filter</var>.name</code>,
        return <code>mismatch</code>. 
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix①">namePrefix</a></code></code> is present then
        if <var>device</var>’s <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name②">Bluetooth Device Name</a> isn’t present
        or doesn’t start with <code><var>filter</var>.namePrefix</code>,
        return <code>mismatch</code>. 
      <li> For each <var>uuid</var> in <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services②">services</a></code></code>,
        if the UA has not received advertising data, an <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response">extended inquiry response</a>,
        or a service discovery response indicating that
        the device supports a primary (vs included) service with UUID <var>uuid</var>,
        return <code>mismatch</code>. 
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata②">manufacturerData</a></code></code> is present then
        for each <var>manufacturerId</var> in <code><var>filter</var>.manufacturerData.<code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys" id="ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">[[OwnPropertyKeys]]</a></code>()</code>,
        if <var>device</var> hasn’t advertised <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data②">manufacturer specific data</a> with a company identifier code that stringifies in base 10 to <var>manufacturerId</var> and with data that <a data-link-type="dfn" href="#bluetoothdatafilterinit-matches" id="ref-for-bluetoothdatafilterinit-matches">matches</a> <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata③">manufacturerData</a></code>[<var>manufacturerId</var>]</code> return <code>mismatch</code>. 
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata②">serviceData</a></code></code> is present then
        for each <var>uuid</var> in <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata③">serviceData</a></code>.<code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys" id="ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys①">[[OwnPropertyKeys]]</a></code>()</code>,
        if <var>device</var> hasn’t advertised <a data-link-type="dfn" href="#service-data" id="ref-for-service-data②">service data</a> with a UUID whose 128-bit form is <var>uuid</var> and with data that <a data-link-type="dfn" href="#bluetoothdatafilterinit-matches" id="ref-for-bluetoothdatafilterinit-matches①">matches</a> <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata④">serviceData</a></code>[<var>manufacturerId</var>]</code>,
        return <code>mismatch</code>. 
      <li>Return <code>match</code>.
     </ol>
    </div>
    <div class="algorithm" data-algorithm="matches">
     <p> An array of bytes <var>data</var> <dfn class="dfn-paneled" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dfn" data-export id="bluetoothdatafilterinit-matches">matches</dfn> a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit①">BluetoothDataFilterInit</a></code> <var>filter</var> if the following steps return <code>match</code>. </p>
     <p class="note" role="note"> Note: This algorithm assumes that <var>filter</var> has already been <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing">canonicalized</a>. </p>
     <ol data-link-for-hint="BluetoothDataFilterInit">
      <li> Let <var>expectedPrefix</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy">a copy of the bytes held</a> by <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix①">dataPrefix</a></code></code>. 
      <li> Let <var>mask</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy①">a copy of the bytes held</a> by <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask②">mask</a></code></code>. 
      <li> If <var>data</var> has fewer bytes than <var>expectedPrefix</var>, return <code>mismatch</code>. 
      <li> For each <code>1</code> bit in <var>mask</var>,
        if the corresponding bit in <var>data</var> is not equal to
        the corresponding bit in <var>expectedPrefix</var>,
        return <code>mismatch</code>. 
      <li> Return <code>match</code>. 
     </ol>
    </div>
    <p class="note" role="note"> The list of Service UUIDs that a device advertises
    might not include all the UUIDs the device supports.
    The advertising data does specify whether this list is complete.
    If a website filters for a UUID that a nearby device supports but doesn’t advertise,
    that device might not be included in the list of devices presented to the user.
    The UA would need to connect to the device to discover the full list of supported services,
    which can impair radio performance and cause delays, so this spec doesn’t require it. </p>
    <div class="algorithm" data-algorithm="requestDevice(options)">
     <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="method" data-export data-lt="requestDevice(options)|requestDevice()" id="dom-bluetooth-requestdevice"><code>requestDevice(<var>options</var>)</code></dfn></code> method,
      when invoked, MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>: </p>
     <ol data-link-for-hint="RequestDeviceOptions">
      <li>
        If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters③">filters</a></code></code> is present
        and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑤">acceptAllDevices</a></code></code> is <code>true</code>,
        or if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters④">filters</a></code></code> is not present
        and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑥">acceptAllDevices</a></code></code> is <code>false</code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①">TypeError</a></code> and abort these steps. 
       <p class="note" role="note"><span>Note:</span> This enforces that
        exactly one of <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑤">filters</a></code> or <code><code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑦">acceptAllDevices</a></code>:true</code> is present.</p>
      <li> <a data-link-type="dfn" href="#request-bluetooth-devices" id="ref-for-request-bluetooth-devices">Request Bluetooth devices</a>,
        passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑥">filters</a></code></code> if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑧">acceptAllDevices</a></code></code> is <code>false</code> or <code>null</code> otherwise,
        and passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices③">optionalServices</a></code></code>,
        and let <var>devices</var> be the result. 
      <li> If the previous step threw an exception, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①">reject</a> <var>promise</var> with that exception and abort these steps. 
      <li> If <var>devices</var> is an empty sequence, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror" id="ref-for-notfounderror">NotFoundError</a></code> and abort these steps. 
      <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code><var>devices</var>[0]</code>. 
     </ol>
    </div>
    <div class="algorithm" data-algorithm="request Bluetooth devices">
     <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="request-bluetooth-devices">request Bluetooth devices</dfn>,
      given a sequence of <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit①">BluetoothLEScanFilterInit</a></code>s, <var>filters</var>,
      which can be <code>null</code> to represent that all devices can match,
      and a sequence of <code class="idl"><a data-link-type="idl" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid②">BluetoothServiceUUID</a></code>s, <var>optionalServices</var>,
      the UA MUST run the following steps: </p>
     <p class="note" role="note"> Note: These steps can block,
      so uses of this algorithm must be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>. </p>
     <p class="note" role="note"> Calls to this algorithm will eventually be able to request multiple devices,
      but for now it only ever returns a single one. </p>
     <ol>
      <li id="requestDevice-user-gesture"><a class="self-link" href="#requestDevice-user-gesture"></a> If the algorithm is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation" id="ref-for-triggered-by-user-activation">triggered by user activation</a>,
        throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror">SecurityError</a></code> and abort these steps. 
      <li>
        In order to convert the arguments from service names and aliases to just <a data-link-type="dfn" href="#uuid" id="ref-for-uuid">UUID</a>s,
        do the following sub-steps: 
       <ol>
        <li> If <code><var>filters</var> !== null &amp;&amp; <var>filters</var>.length === 0</code>,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror②">TypeError</a></code> and abort these steps. 
        <li> Let <var>uuidFilters</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects">Array</a></code> and <var>requiredServiceUUIDs</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-set-objects" id="ref-for-sec-set-objects">Set</a></code>. 
        <li> If <var>filters</var> is <code>null</code>,
            then set <var>requiredServiceUUIDs</var> to the set of all UUIDs. 
        <li>
          If <var>filters</var> isn’t <code>null</code>,
            then for each <var>filter</var> in <var>filters</var>,
            do the following steps: 
         <ol>
          <li> Let <var>canonicalFilter</var> be
                the result of <a data-link-type="dfn" href="#bluetoothlescanfilterinit-canonicalizing" id="ref-for-bluetoothlescanfilterinit-canonicalizing">canonicalizing</a> <var>filter</var>. 
          <li> Append <var>canonicalFilter</var> to <var>uuidFilters</var>. 
          <li> Add the contents of <code><var>canonicalFilter</var>.services</code> to <var>requiredServiceUUIDs</var>. 
         </ol>
        <li> Let <var>optionalServiceUUIDs</var> be <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map">Array.prototype.map</a></code>.call(<var>optionalServices</var>, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice">BluetoothUUID.getService</a></code>)</code>. 
        <li> If any of the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①">BluetoothUUID.getService()</a></code> calls threw an exception,
            throw that exception and abort these steps. 
        <li> Remove from <var>optionalServiceUUIDs</var> any UUIDs that are <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted">blocklisted</a>. 
       </ol>
      <li>
        Let <var>descriptor</var> be 
<pre class="highlight"><c- p>{</c->
  name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c->
  filters<c- o>:</c-> <var>uuidFilters</var><c- p>,</c->
  optionalServices<c- o>:</c-> <var>optionalServiceUUIDs</var><c- p>,</c->
  acceptAllDevices<c- o>:</c-> <var>filters</var> <c- o>!==</c-> <c- kc>null</c-><c- p>,</c->
<c- p>}</c->
</pre>
      <li>
        Let <var>state</var> be <var>descriptor</var>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-state" id="ref-for-permission-state">permission state</a>. 
       <p class="note" role="note"><span>Note:</span> <var>state</var> will be <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied">"denied"</a></code> in <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts" id="ref-for-non-secure-contexts">non-secure contexts</a> because <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth">"bluetooth"</a></code> doesn’t set the <a data-link-type="dfn" href="https://w3c.github.io/permissions/#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts">allowed in non-secure contexts</a> flag.</p>
      <li> If <var>state</var> is <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①">"denied"</a></code>, return <code>[]</code> and abort these steps. 
      <li> If the UA can prove that no devices could possibly be found in the next step,
        for example because there is no Bluetooth adapter with which to scan,
        or because the filters can’t be matched by any possible advertising packet,
        the UA MAY return <code>[]</code> and abort these steps. 
      <li> <a data-link-type="dfn" href="#scan-for-devices" id="ref-for-scan-for-devices">Scan for devices</a> with <var>requiredServiceUUIDs</var> as the <i>set of <a data-link-type="dfn" href="#service" id="ref-for-service①">Service</a> UUIDs</i>,
        and let <var>scanResult</var> be the result. 
      <li> If <var>filters</var> isn’t null,
        remove devices from <var>scanResult</var> if
        they do not <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter②">match a filter</a> in <var>uuidFilters</var>. 
      <li id="requestDevice-prompt">
       <a class="self-link" href="#requestDevice-prompt"></a> Even if <var>scanResult</var> is empty, <a data-link-type="dfn" href="https://w3c.github.io/permissions/#prompt-the-user-to-choose" id="ref-for-prompt-the-user-to-choose">prompt the user to choose</a> one of the devices in <var>scanResult</var>,
        associated with <var>descriptor</var>,
        and let <var>device</var> be the result. 
       <p> The UA MAY allow the user to select a nearby device
          that does not match <var>uuidFilters</var>. </p>
       <p class="note" role="note"> The UA should show the user the human-readable name of each device.
          If this name is not available because, for example,
          the UA’s Bluetooth system doesn’t support privacy-enabled scans,
          the UA should allow the user to indicate interest and
          then perform a privacy-disabled scan to retrieve the name. </p>
      <li> If <var>device</var> is <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied②">"denied"</a></code>, return <code>[]</code> and abort these steps. 
      <li class="note"> Choosing a <var>device</var> probably indicates that
        the user intends that device to appear in
        the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices">allowedDevices</a></code> list
        of <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth①">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data">extra permission data</a> for
        at least the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object">current settings object</a>,
        for its <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt">mayUseGATT</a></code> field to be <code>true</code>,
        and for all the services in the union of <var>requiredServiceUUIDs</var> and <var>optionalServiceUUIDs</var> to appear in its <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices">allowedServices</a></code> list,
        in addition to any services that were already there. 
      <li> The UA MAY <a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache">populate the Bluetooth cache</a> with
        all Services inside <var>device</var>.
        Ignore any errors from this step. 
      <li> <a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing①">Get the <code>BluetoothDevice</code> representing</a> <var>device</var> inside the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object">context object</a>,
        propagating any exception,
        and let <var>deviceObj</var> be the result. 
      <li> Return <code>[<var>deviceObj</var>]</code>. 
     </ol>
    </div>
    <div class="algorithm" data-algorithm="canonicalizing an LE scan filter">
     <p> The result of <dfn class="dfn-paneled" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dfn" data-export id="bluetoothlescanfilterinit-canonicalizing">canonicalizing</dfn> the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit②">BluetoothLEScanFilterInit</a></code> <var>filter</var>,
      is the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit③">BluetoothLEScanFilterInit</a></code> returned from the following steps: </p>
     <ol>
      <li> If none of <var>filter</var>’s
        members is present,
        throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror③">TypeError</a></code> and abort these steps. 
      <li>Let <var>canonicalizedFilter</var> be <code>{}</code>.
      <li>
        If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services③">services</a></code></code> is present,
        do the following sub-steps: 
       <ol>
        <li> If <code><var>filter</var>.services.length === 0</code>,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror④">TypeError</a></code> and abort these steps. 
        <li> Let <var>services</var> be <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map①">Array.prototype.map</a></code>.call(<var>filter</var>.services, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice②">BluetoothUUID.getService</a></code>)</code>. 
        <li> If any of the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice③">BluetoothUUID.getService()</a></code> calls
            threw an exception,
            throw that exception and abort these steps. 
        <li> If any service in <var>services</var> is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted①">blocklisted</a>,
            throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①">SecurityError</a></code> and abort these steps. 
        <li> Set <code><var>canonicalizedFilter</var>.services</code> to <var>services</var>. 
       </ol>
      <li>
        If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name②">name</a></code></code> is present,
        do the following sub-steps. 
       <ol>
        <li>
          If the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode">UTF-8 encoding</a> of <code><var>filter</var>.name</code> is more than 248 bytes long,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑤">TypeError</a></code> and abort these steps. 
         <p class="note" role="note"> 248 is the maximum number of UTF-8 code units in
              a <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name③">Bluetooth Device Name</a>. </p>
        <li> Set <code><var>canonicalizedFilter</var>.name</code> to <code><var>filter</var>.name</code>. 
       </ol>
      <li>
        If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix②">namePrefix</a></code></code> is present,
        do the following sub-steps. 
       <ol>
        <li>
          If <code><var>filter</var>.namePrefix.length === 0</code> or if the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode①">UTF-8 encoding</a> of <code><var>filter</var>.namePrefix</code> is more than 248 bytes long,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑥">TypeError</a></code> and abort these steps. 
         <p class="note" role="note"> 248 is the maximum number of UTF-8 code units in
              a <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name④">Bluetooth Device Name</a>. </p>
        <li> Set <code><var>canonicalizedFilter</var>.namePrefix</code> to <code><var>filter</var>.namePrefix</code>. 
       </ol>
      <li> Set <code><var>canonicalizedFilter</var>.manufacturerData</code> to <code>{}</code>. 
      <li>
        If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata④">manufacturerData</a></code></code> is present,
        do the following sub-steps for each <var>key</var> in <code><var>filter</var>.manufacturerData.<code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys" id="ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys②">[[OwnPropertyKeys]]</a></code>()</code>.
        If there are no such keys, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑦">TypeError</a></code> and abort these steps. 
       <ol>
        <li> Let <var>manufacturerId</var> be <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-canonicalnumericindexstring" id="ref-for-sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>(<var>key</var>). 
        <li> If <var>manufacturerId</var> is <code>undefined</code> or <code>-0</code>,
            or <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-isinteger" id="ref-for-sec-isinteger">IsInteger</a>(<var>manufacturerId</var>) is <code>false</code>,
            or <var>manufacturerId</var> is outside the range from 0–65535 inclusive,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑧">TypeError</a></code> and abort these steps. 
        <li> Let <var>dataFilter</var> be <code><var>filter</var>.manufacturerData[<var>manufacturerId</var>]</code>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value">converted to an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit②">BluetoothDataFilterInit</a></code>.
            If this conversion throws an exception, propagate it and abort these steps. 
        <li> Let <var>canonicalizedDataFilter</var> be
            the result of <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing①">canonicalizing</a> <var>dataFilter</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-idl-to-ecmascript-value" id="ref-for-dfn-convert-idl-to-ecmascript-value">converted to an ECMAScript value</a>.
            If this throws an exception, propagate that exception and abort these steps. 
        <li> Call <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-createdataproperty" id="ref-for-sec-createdataproperty">CreateDataProperty</a>(<var>canonicalizedFilter</var>.manufacturerData, <var>key</var>, <var>canonicalizedDataFilter</var>). 
       </ol>
      <li> Set <code><var>canonicalizedFilter</var>.serviceData</code> to <code>{}</code>. 
      <li>
        If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata⑤">serviceData</a></code></code> is present,
        do the following sub-steps for each <var>key</var> in <code><var>filter</var>.serviceData.<code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys" id="ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys③">[[OwnPropertyKeys]]</a></code>()</code>.
        If there are no such keys, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑨">TypeError</a></code> and abort these steps. 
       <ol>
        <li> Let <var>serviceName</var> be <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-canonicalnumericindexstring" id="ref-for-sec-canonicalnumericindexstring①">CanonicalNumericIndexString</a>(<var>key</var>). 
        <li> If <var>serviceName</var> is <code>undefined</code>, set <var>serviceName</var> to <var>key</var>. 
        <li> Let <var>service</var> be <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice④">BluetoothUUID.getService</a></code>(<var>serviceName</var>)</code>. 
        <li> If the previous step threw an exception,
            throw that exception and abort these steps. 
        <li> If <var>service</var> is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted②">blocklisted</a>,
            throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror②">SecurityError</a></code> and abort these steps. 
        <li> Let <var>dataFilter</var> be <code><var>filter</var>.serviceData[<var>service</var>]</code>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value①">converted to an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit③">BluetoothDataFilterInit</a></code>.
            If this conversion throws an exception, propagate it and abort these steps. 
        <li> Let <var>canonicalizedDataFilter</var> be
            the result of <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing②">canonicalizing</a> <var>dataFilter</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-idl-to-ecmascript-value" id="ref-for-dfn-convert-idl-to-ecmascript-value①">converted to an ECMAScript value</a>.
            If this throws an exception, propagate that exception and abort these steps. 
        <li> Call <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-createdataproperty" id="ref-for-sec-createdataproperty①">CreateDataProperty</a>(<var>canonicalizedFilter</var>.serviceData, <var>service</var>, <var>canonicalizedDataFilter</var>). 
       </ol>
      <li>Return <var>canonicalizedFilter</var>.
     </ol>
    </div>
    <div class="algorithm" data-algorithm="canonicalizing a data filter">
     <p> The result of <dfn class="dfn-paneled" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dfn" data-export id="bluetoothdatafilterinit-canonicalizing">canonicalizing</dfn> the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit④">BluetoothDataFilterInit</a></code> <var>filter</var>,
      is the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑤">BluetoothDataFilterInit</a></code> returned from the following steps: </p>
     <ol>
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix②">dataPrefix</a></code></code> is present,
        let <var>dataPrefix</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy②">a copy of the bytes held</a> by <code><var>filter</var>.dataPrefix</code>.
        Otherwise, let <var>dataPrefix</var> be an empty sequence of bytes. 
      <li> If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask③">mask</a></code></code> is present,
        let <var>mask</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy③">a copy of the bytes held</a> by <code><var>filter</var>.mask</code>.
        Otherwise, let <var>mask</var> be a sequence of <code>0xFF</code> bytes the same length as <var>dataPrefix</var>. 
      <li> If <var>mask</var> is not the same length as <var>dataPrefix</var>,
        throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⓪">TypeError</a></code> and abort these steps. 
      <li> Return <code>{dataPrefix: new Uint8Array(|dataPrefix|), mask: new Uint8Array(|mask|)}</code>. 
     </ol>
    </div>
    <div class="algorithm" data-algorithm="scan for devices">
     <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="scan-for-devices">scan for devices</dfn> with
      an optional <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service②">Service</a> UUIDs</var>, defaulting to the set of all UUIDs,
      the UA MUST perform the following steps: </p>
     <ol>
      <li> If the UA has scanned for devices recently <span class="issue" id="issue-2f91a41d"><a class="self-link" href="#issue-2f91a41d"></a>TODO: Nail down the amount of time.</span> with a set of UUIDs that was a superset of the UUIDs for the current scan,
        then the UA MAY return the result of that scan and abort these steps. 
      <li> Let <var>nearbyDevices</var> be a set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device④">Bluetooth device</a>s,
        initially equal to the set of devices that
        are connected (have an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer">ATT Bearer</a>) to the UA. 
      <li>
        If the UA supports the LE transport, perform the <a data-link-type="dfn" href="#general-discovery-procedure" id="ref-for-general-discovery-procedure">General Discovery Procedure</a>,
        except that the UA may include devices that have no <a data-link-type="dfn" href="#discoverable-mode" id="ref-for-discoverable-mode">Discoverable Mode</a> flag set,
        and add the discovered <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑤">Bluetooth device</a>s to <var>nearbyDevices</var>.
        The UA SHOULD enable the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature③">Privacy Feature</a>. 
       <p class="issue" id="issue-b71bd84d"><a class="self-link" href="#issue-b71bd84d"></a> Both <a data-link-type="dfn" href="#passive-scanning" id="ref-for-passive-scanning">passive scanning</a> and
          the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature④">Privacy Feature</a> avoid leaking the unique, immutable device ID.
          We ought to require UAs to use either one,
          but none of the OS APIs appear to expose either.
          Bluetooth also makes it hard to use <a data-link-type="dfn" href="#passive-scanning" id="ref-for-passive-scanning①">passive scanning</a> since
          it doesn’t require <a data-link-type="dfn" href="#central" id="ref-for-central③">Central</a> devices to support the <a data-link-type="dfn" href="#observation-procedure" id="ref-for-observation-procedure">Observation Procedure</a>. </p>
      <li>
        If the UA supports the BR/EDR transport, perform the <a data-link-type="dfn" href="#device-discovery-procedure" id="ref-for-device-discovery-procedure">Device Discovery Procedure</a> and add the discovered <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑥">Bluetooth device</a>s to <var>nearbyDevices</var>. 
       <p class="issue" id="issue-9bb159fd"><a class="self-link" href="#issue-9bb159fd"></a> All forms of BR/EDR inquiry/discovery
          appear to leak the unique, immutable device address. </p>
      <li>Let <var>result</var> be a set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑦">Bluetooth device</a>s, initially empty.
      <li>
        For each <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑧">Bluetooth device</a> <var>device</var> in <var>nearbyDevices</var>,
        do the following sub-steps: 
       <ol>
        <li> If <var>device</var>’s <a data-link-type="dfn" href="#supported-physical-transports" id="ref-for-supported-physical-transports">supported physical transports</a> include LE and
            its <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑤">Bluetooth Device Name</a> is partial or absent,
            the UA SHOULD perform the <a data-link-type="dfn" href="#name-discovery-procedure" id="ref-for-name-discovery-procedure">Name Discovery Procedure</a> to acquire a complete name. 
        <li>
          If <var>device</var>’s advertised <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type">Service UUIDs</a> have a non-empty intersection with the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service③">Service</a> UUIDs</var>,
            add <var>device</var> to <var>result</var> and abort these sub-steps. 
         <p class="note" role="note"> For BR/EDR devices, there is no way to distinguish GATT from non-GATT services
              in the <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response①">Extended Inquiry Response</a>.
              If a site filters to the UUID of a non-GATT service,
              the user may be able to select a device
              for the result of <code>requestDevice</code> that this API provides no way to interact with. </p>
        <li>
          The UA MAY connect to <var>device</var> and <a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache①">populate the Bluetooth cache</a> with all Services whose UUIDs are in the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service④">Service</a> UUIDs</var>.
            If <var>device</var>’s <a data-link-type="dfn" href="#supported-physical-transports" id="ref-for-supported-physical-transports①">supported physical transports</a> include BR/EDR,
            then in addition to the standard GATT procedures,
            the UA MAY use the Service Discovery Protocol (<a data-link-type="dfn" href="#searching-for-services" id="ref-for-searching-for-services">Searching for Services</a>)
            when populating the cache. 
         <div class="note" id="note-extra-discovery" role="note">
          <a class="self-link" href="#note-extra-discovery"></a> 
          <p> Connecting to every nearby device to discover services costs power and
                can slow down other use of the Bluetooth radio.
                UAs should only discover extra services on a device if
                they have some reason to expect that device to be interesting. </p>
          <p> UAs should also help developers avoid relying on this extra discovery behavior.
                For example, say a developer has previously connected to a device,
                so the UA knows the device’s full set of supported services.
                If this developer then filters using a non-advertised UUID,
                the dialog they see may include this device,
                even if the filter would likely exclude the device on users' machines.
                The UA could provide a developer option to warn when this happens or
                to include only advertised services in matching filters. </p>
         </div>
        <li> If the <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache①">Bluetooth cache</a> contains
            known-present Services inside <var>device</var> with UUIDs in the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service⑤">Service</a> UUIDs</var>,
            the UA MAY add <var>device</var> to <var>result</var>. 
       </ol>
      <li>Return <var>result</var> from the scan.
     </ol>
    </div>
    <p class="issue" id="issue-ad5723d8"><a class="self-link" href="#issue-ad5723d8"></a> We need a way for a site to register to receive an event
    when an interesting device comes within range. </p>
    <section class="unstable">
     <h3 class="heading settled" data-level="3.1" id="permission-api-integration"><span class="secno">3.1. </span><span class="content">Permission API Integration</span><a class="self-link" href="#permission-api-integration"></a></h3>
     <p> The <a data-link-type="biblio" href="#biblio-permissions">[permissions]</a> API provides a uniform way
      for websites to request permissions from users
      and query which permissions they have. </p>
     <div class="example" id="example-permission-api-request">
      <a class="self-link" href="#example-permission-api-request"></a> 
      <p> Sites can use <code class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><code class="idl"><a data-link-type="idl" href="https://wicg.github.io/permissions-request/#dom-permissions-request" id="ref-for-dom-permissions-request">request</a></code><c- p>({</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name">name</a><c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c-> <c- p>...})</c-></code> as an alternate spelling of <code class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c-><code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice④">requestDevice<c- p>()</c-></a></code></code>. </p>
<pre class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><a data-link-type="idl" href="https://wicg.github.io/permissions-request/#dom-permissions-request" id="ref-for-dom-permissions-request①">request</a><c- p>({</c->
  name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c->
  filters<c- o>:</c-> <c- p>[{</c->
    services<c- o>:</c-> <c- p>[</c-><c- t>'heart_rate'</c-><c- p>],</c->
  <c- p>}]</c->
<c- p>}).</c->then<c- p>(</c->result <c- p>=></c-> <c- p>{</c->
  <c- k>if</c-> <c- p>(</c->result<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothpermissionresult-devices" id="ref-for-dom-bluetoothpermissionresult-devices">devices</a><c- p>.</c->length <c- o>>=</c-> <c- mi>1</c-><c- p>)</c-> <c- p>{</c->
    <c- k>return</c-> result<c- p>.</c->devices<c- p>[</c-><c- mi>0</c-><c- p>];</c->
  <c- p>}</c-> <c- k>else</c-> <c- p>{</c->
    <c- k>throw</c-> <c- k>new</c-> <a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a><c- p>(</c-><c- u>"Chooser cancelled"</c-><c- p>,</c-> <c- u>"NotFoundError"</c-><c- p>);</c->
  <c- p>}</c->
<c- p>}).</c->then<c- p>(</c->device <c- p>=></c-> <c- p>{</c->
  sessionStorage<c- p>.</c->lastDevice <c- o>=</c-> device<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id">id</a><c- p>;</c->
<c- p>});</c->
</pre>
      <p> The <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-deviceid" id="ref-for-dom-bluetoothpermissiondescriptor-deviceid">deviceId</a></code> member
        is ignored in calls to <code class="idl"><a data-link-type="idl" href="https://wicg.github.io/permissions-request/#dom-permissions-request" id="ref-for-dom-permissions-request②">request()</a></code>. </p>
     </div>
     <div class="example" id="example-permission-api-query">
      <a class="self-link" href="#example-permission-api-query"></a> 
      <p> Once a site has been granted access to a set of devices,
        it can use <code class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissions-query" id="ref-for-dom-permissions-query">query</a></code><c- p>({</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①">name</a><c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c-> <c- p>...})</c-></code> to retrieve those devices after a reload. </p>
<pre class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissions-query" id="ref-for-dom-permissions-query①">query</a><c- p>({</c->
  name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c->
  deviceId<c- o>:</c-> sessionStorage<c- p>.</c->lastDevice<c- p>,</c->
<c- p>}).</c->then<c- p>(</c->result <c- p>=></c-> <c- p>{</c->
  <c- k>if</c-> <c- p>(</c->result<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothpermissionresult-devices" id="ref-for-dom-bluetoothpermissionresult-devices①">devices</a><c- p>.</c->length <c- o>==</c-> <c- mi>1</c-><c- p>)</c-> <c- p>{</c->
    <c- k>return</c-> result<c- p>.</c->devices<c- p>[</c-><c- mi>0</c-><c- p>];</c->
  <c- p>}</c-> <c- k>else</c-> <c- p>{</c->
    <c- k>throw</c-> <c- k>new</c-> <a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException①">DOMException</a><c- p>(</c-><c- u>"Lost permission"</c-><c- p>,</c-> <c- u>"NotFoundError"</c-><c- p>);</c->
  <c- p>}</c->
<c- p>}).</c->then<c- p>(...);</c->
</pre>
     </div>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-bluetooth"><code>"bluetooth"</code></dfn> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#powerful-feature" id="ref-for-powerful-feature">powerful feature</a>’s
      permission-related algorithms and types
      are defined as follows: </p>
     <dl>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-descriptor-type" id="ref-for-permission-descriptor-type">permission descriptor type</a> 
      <dd>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothpermissiondescriptor"><code><c- g>BluetoothPermissionDescriptor</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-bluetoothpermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code></dfn>;
  // These match RequestDeviceOptions.
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit④"><c- n>BluetoothLEScanFilterInit</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="sequence<BluetoothLEScanFilterInit> " id="dom-bluetoothpermissiondescriptor-filters"><code><c- g>filters</c-></code></dfn>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid③"><c- n>BluetoothServiceUUID</c-></a>> <dfn class="dfn-paneled idl-code" data-default="[]" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="sequence<BluetoothServiceUUID> " id="dom-bluetoothpermissiondescriptor-optionalservices"><code><c- g>optionalServices</c-></code></dfn> = [];
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-bluetoothpermissiondescriptor-acceptalldevices"><code><c- g>acceptAllDevices</c-></code></dfn> = <c- b>false</c->;
};
</pre>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data-type" id="ref-for-extra-permission-data-type">extra permission data type</a> 
      <dd>
       <p oldids="allowed-devices-map,device-id,allowed-services-list"> <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondata" id="ref-for-dictdef-bluetoothpermissiondata">BluetoothPermissionData</a></code>, defined as:</p>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-allowedbluetoothdevice"><code><c- g>AllowedBluetoothDevice</c-></code></dfn> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-allowedbluetoothdevice-deviceid"><code><c- g>deviceId</c-></code></dfn>;
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-allowedbluetoothdevice-mayusegatt"><code><c- g>mayUseGATT</c-></code></dfn>;
  // An allowedServices of "all" means all services are allowed.
  <c- b>required</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④"><c- b>DOMString</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid"><c- n>UUID</c-></a>>) <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="(DOMString or sequence<UUID>) " id="dom-allowedbluetoothdevice-allowedservices"><code><c- g>allowedServices</c-></code></dfn>;
};
<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothpermissiondata"><code><c- g>BluetoothPermissionData</c-></code></dfn> {
  <c- b>required</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice"><c- n>AllowedBluetoothDevice</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionData" data-dfn-type="dict-member" data-export data-type="sequence<AllowedBluetoothDevice> " id="dom-bluetoothpermissiondata-alloweddevices"><code><c- g>allowedDevices</c-></code></dfn>;
};
</pre>
       <p> <code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice①">AllowedBluetoothDevice</a></code> instances have an <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots②">internal slot</a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="attribute" data-export id="dom-allowedbluetoothdevice-device-slot"><code>[[device]]</code></dfn> that holds a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑨">Bluetooth device</a>. </p>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data-constraints" id="ref-for-extra-permission-data-constraints">extra permission data constraints</a> 
      <dd>
       <p> Distinct elements of <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices①">allowedDevices</a></code> must have different <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot">[[device]]</a></code>s
          and different <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid">deviceId</a></code>s. </p>
       <p> If <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt①">mayUseGATT</a></code> is <code>false</code>, <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices①">allowedServices</a></code> must be <code>[]</code>. </p>
       <div class="note" id="note-device-id-tracking" role="note">
        <a class="self-link" href="#note-device-id-tracking"></a> 
        <p> A <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid①">deviceId</a></code> allows a site to track that
            a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑥">BluetoothDevice</a></code> instance seen at one time represents
            the same device as another <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑦">BluetoothDevice</a></code> instance seen at another time,
            possibly in a different <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms①">realm</a>.
            UAs should consider whether their user intends that tracking to happen or not-happen
            when returning <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth②">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data①">extra permission data</a>. </p>
        <p> For example, users generally don’t intend two different origins to know
            that they’re interacting with the same device,
            and they generally don’t intend unique identifiers to persist
            after they’ve cleared an origin’s cookies. </p>
       </div>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-result-type" id="ref-for-permission-result-type">permission result type</a> 
      <dd>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothpermissionresult"><code><c- g>BluetoothPermissionResult</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#permissionstatus" id="ref-for-permissionstatus"><c- n>PermissionStatus</c-></a> {
  <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑧"><c- n>BluetoothDevice</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionResult" data-dfn-type="attribute" data-export data-type="FrozenArray<BluetoothDevice>" id="dom-bluetoothpermissionresult-devices"><code><c- g>devices</c-></code></dfn>;
};
</pre>
      <dt> <a data-link-type="dfn" href="https://wicg.github.io/permissions-request/#permission-request-algorithm" id="ref-for-permission-request-algorithm">permission request algorithm</a> 
      <dd class="algorithm" data-algorithm="permission request">
       <p> To <dfn data-dfn-type="dfn" data-export id="request-the-bluetooth-permission">request the "bluetooth" permission<a class="self-link" href="#request-the-bluetooth-permission"></a></dfn> with
          a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondescriptor" id="ref-for-dictdef-bluetoothpermissiondescriptor">BluetoothPermissionDescriptor</a></code> <var>options</var> and a <code class="idl"><a data-link-type="idl" href="#bluetoothpermissionresult" id="ref-for-bluetoothpermissionresult">BluetoothPermissionResult</a></code> <var>status</var>,
          the UA MUST run the following steps: </p>
       <ol data-link-for-hint="BluetoothPermissionDescriptor">
        <li>
          If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-filters" id="ref-for-dom-bluetoothpermissiondescriptor-filters">filters</a></code></code> is present
            and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-acceptalldevices" id="ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices">acceptAllDevices</a></code></code> is <code>true</code>,
            or if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-filters" id="ref-for-dom-bluetoothpermissiondescriptor-filters①">filters</a></code></code> is not present
            and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-acceptalldevices" id="ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices①">acceptAllDevices</a></code></code> is <code>false</code>,
            throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①①">TypeError</a></code>. 
         <p class="note" role="note"><span>Note:</span> This enforces that
            exactly one of <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-filters" id="ref-for-dom-bluetoothpermissiondescriptor-filters②">filters</a></code> or <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-acceptalldevices" id="ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices②">acceptAllDevices</a></code>:true</code> is present.</p>
        <li> <a data-link-type="dfn" href="#request-bluetooth-devices" id="ref-for-request-bluetooth-devices①">Request Bluetooth devices</a>,
            passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-filters" id="ref-for-dom-bluetoothpermissiondescriptor-filters③">filters</a></code></code> if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-acceptalldevices" id="ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices③">acceptAllDevices</a></code></code> is <code>false</code> or <code>null</code> otherwise,
            and passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondescriptor-optionalservices" id="ref-for-dom-bluetoothpermissiondescriptor-optionalservices">optionalServices</a></code></code>,
            propagating any exception,
            and let <var>devices</var> be the result. 
        <li> Set <code><var>status</var>.devices</code> to
            a new <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array">FrozenArray</a></code> whose contents are the elements of <var>devices</var>. 
       </ol>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-query-algorithm" id="ref-for-permission-query-algorithm">permission query algorithm</a> 
      <dd class="algorithm" data-algorithm="query the &quot;bluetooth&quot; permission">
        To <dfn data-dfn-type="dfn" data-export id="query-the-bluetooth-permission">query the "bluetooth" permission<a class="self-link" href="#query-the-bluetooth-permission"></a></dfn> with
        a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondescriptor" id="ref-for-dictdef-bluetoothpermissiondescriptor①">BluetoothPermissionDescriptor</a></code> <var>desc</var> and a <code class="idl"><a data-link-type="idl" href="#bluetoothpermissionresult" id="ref-for-bluetoothpermissionresult①">BluetoothPermissionResult</a></code> <var>status</var>, the UA must: 
       <ol>
        <li> Let <var>global</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global">relevant global object</a> for <var>status</var>. 
        <li> Set <code><var>status</var>.<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state">state</a></code></code> to <var>desc</var>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-state" id="ref-for-permission-state①">permission state</a>. 
        <li> If <code><var>status</var>.<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state①">state</a></code></code> is <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied③">"denied"</a></code>,
            set <code><var>status</var>.devices</code> to an empty <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array①">FrozenArray</a></code> and abort these steps. 
        <li> Let <var>matchingDevices</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects①">Array</a></code>. 
        <li> Let <var>data</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondata" id="ref-for-dictdef-bluetoothpermissiondata①">BluetoothPermissionData</a></code>,
            be <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth③">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data②">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①">current settings object</a>. 
        <li>
          For each <var>allowedDevice</var> in <code><var>data</var>.allowedDevices</code>,
            run the following sub-steps: 
         <ol>
          <li> If <code><var>desc</var>.deviceId</code> is set
                and <code><var>allowedDevice</var>.deviceId != <var>desc</var>.deviceId</code>,
                continue to the next <var>allowedDevice</var>. 
          <li>
            If <code><var>desc</var>.filters</code> is set, do the following sub-steps: 
           <ol>
            <li> Replace each filter in <code><var>desc</var>.filters</code> with the result of <a data-link-type="dfn" href="#bluetoothlescanfilterinit-canonicalizing" id="ref-for-bluetoothlescanfilterinit-canonicalizing①">canonicalizing</a> it.
                    If any of these canonicalizations throws an error, return that error and abort these steps. 
            <li> If <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot①">[[device]]</a></code></code> does not <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter③">match a filter</a> in <code><var>desc</var>.filters</code>,
                    continue to the next <var>allowedDevice</var>. 
           </ol>
          <li> <a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing②">Get the <code>BluetoothDevice</code> representing</a> <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot②">[[device]]</a></code></code> within <code><var>global</var>.navigator.bluetooth</code>,
                and add the result to <var>matchingDevices</var>. 
         </ol>
         <p class="note" role="note"> Note: The <code><var>desc</var>.optionalServices</code> field does not affect the result. </p>
        <li> Set <code><var>status</var>.devices</code> to
            a new <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array②">FrozenArray</a></code> whose contents are <var>matchingDevices</var>. 
       </ol>
      <dt> <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm">permission revocation algorithm</a> 
      <dd class="algorithm" data-algorithm="revoke Bluetooth access">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="revoke-bluetooth-access">revoke Bluetooth access</dfn> to devices the user no longer intends to expose,
          the UA MUST run the following steps: </p>
       <ol>
        <li> Let <var>data</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondata" id="ref-for-dictdef-bluetoothpermissiondata②">BluetoothPermissionData</a></code>,
            be <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth④">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data③">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object②">current settings object</a>. 
        <li>
          For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑨">BluetoothDevice</a></code> instance <var>deviceObj</var> in the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#current-realm" id="ref-for-current-realm">current realm</a>,
            run the following sub-steps: 
         <ol>
          <li>
            If there is an <code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice②">AllowedBluetoothDevice</a></code> <var>allowedDevice</var> in <code><var>data</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices②">allowedDevices</a></code></code> such that: 
           <ul>
            <li> <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot③">[[device]]</a></code></code> is
                    the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device">same device</a> as <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot">[[representedDevice]]</a></code></code>, and 
            <li> <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid②">deviceId</a></code> === <var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id①">id</a></code></code>, 
           </ul>
            then update <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot">[[allowedServices]]</a></code></code> to be <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices②">allowedServices</a></code></code>,
                and continue to the next <var>deviceObj</var>. 
          <li> Otherwise, detach <var>deviceObj</var> from its device by running the remaining steps. 
          <li>
            Call <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect">disconnect()</a></code></code>. 
           <p class="note" role="note"><span>Note:</span> This fires a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-gattserverdisconnected" id="ref-for-eventdef-bluetoothdevice-gattserverdisconnected">gattserverdisconnected</a></code> event at <var>deviceObj</var>.</p>
          <li> Set <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①">[[representedDevice]]</a></code></code> to <code>null</code>. 
         </ol>
       </ol>
     </dl>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.2" id="availability"><span class="secno">3.2. </span><span class="content">Overall Bluetooth availability</span><a class="self-link" href="#availability"></a></h3>
     <p> The UA may be running on a computer that has no Bluetooth radio. <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice⑤">requestDevice()</a></code> handles this by failing to discover any devices,
      which results in a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror" id="ref-for-notfounderror①">NotFoundError</a></code>,
      but websites may be able to handle it more gracefully. </p>
     <div class="example" id="example-getavailability">
      <a class="self-link" href="#example-getavailability"></a> 
      <p> To show Bluetooth UI only to users who have a Bluetooth adapter: </p>
<pre class="highlight"><c- kr>const</c-> bluetoothUI <c- o>=</c-> document<c- p>.</c->querySelector<c- p>(</c-><c- t>'#bluetoothUI'</c-><c- p>);</c->
navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability③">getAvailability<c- p>()</c-></a><c- p>.</c->then<c- p>(</c->isAvailable <c- p>=></c-> <c- p>{</c->
  bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->isAvailable<c- p>;</c->
<c- p>});</c->
navigator<c- p>.</c->bluetooth<c- p>.</c->addEventListener<c- p>(</c-><c- t>'</c-><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged①"><c- t>availabilitychanged</c-></a><c- t>'</c-><c- p>,</c-> e <c- p>=></c-> <c- p>{</c->
  bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->e<c- p>.</c->value<c- p>;</c->
<c- p>});</c->
</pre>
     </div>
     <div class="algorithm" data-algorithm="getAvailability()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="method" data-export id="dom-bluetooth-getavailability"><code>getAvailability()</code></dfn></code> method,
        when invoked, MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>: </p>
      <ol>
       <li id="override-availability">
        <a class="self-link" href="#override-availability"></a> If the user has configured the UA to
          return a particular answer from this function for the current origin, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">queue a task</a> to <a data-link-type="dfn">resolve</a> <var>promise</var> with the configured answer,
          and abort these steps. 
        <p class="note" role="note"><span>Note:</span> If the Web Bluetooth permission has been blocked by the user,
          the UA may <a data-link-type="dfn">resolve</a> <var>promise</var> with <code>false</code>.</p>
       <li> If the UA is running on a system that has a Bluetooth radio <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①">queue a task</a> to <a data-link-type="dfn">resolve</a> <var>promise</var> with <code>true</code> regardless
          of the powered state of the Bluetooth radio. 
       <li> Otherwise, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②">queue a task</a> to <a data-link-type="dfn">resolve</a> <var>promise</var> with <code>false</code>. 
      </ol>
      <p class="note" role="note"><span>Note:</span> The promise is resolved <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a> to let the UA call out to other systems
      to determine whether Bluetooth is available.</p>
     </div>
     <div class="example" id="example-getAvailability-PermissionStatus-onchange">
      <a class="self-link" href="#example-getAvailability-PermissionStatus-onchange"></a> 
      <p>If the user has blocked the permission and the UA resolves the <code><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability④">getAvailability</a></code> promise with false, the following can be used to detect
      when Bluetooth is available again to show Bluetooth UI:</p>
<pre class="highlight"><c- a>function</c-> checkAvailability<c- p>()</c-> <c- p>{</c->
  <c- kr>const</c-> bluetoothUI <c- o>=</c-> document<c- p>.</c->querySelector<c- p>(</c-><c- t>'#bluetoothUI'</c-><c- p>);</c->
  navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑤">getAvailability<c- p>()</c-></a><c- p>.</c->then<c- p>(</c->isAvailable <c- p>=></c-> <c- p>{</c->
    bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->isAvailable<c- p>;</c->
  <c- p>});</c->
<c- p>}</c->

navigator<c- p>.</c->permission<c- p>.</c->query<c- p>({</c->name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>}).</c->then<c- p>(</c->status <c- p>=></c-> <c- p>{</c->
  <c- k>if</c-> <c- p>(</c->status<c- p>.</c->state <c- o>!==</c-> <c- t>'denied'</c-><c- p>)</c-> checkAvailability<c- p>();</c->

  <c- c1>// Bluetooth is blocked, listen for change in PermissionStatus.</c->
  status<c- p>.</c->onchange <c- o>=</c-> <c- p>()</c-> <c- p>=></c-> <c- p>{</c->
    <c- k>if</c-> <c- p>(</c-><c- k>this</c-><c- p>.</c->state <c- o>!==</c-> <c- t>'denied'</c-><c- p>)</c-> checkAvailability<c- p>();</c->
  <c- p>};</c->
<c- p>});</c->
</pre>
     </div>
     <div class="unstable algorithm" data-algorithm="availabilitychanged" id="availability-changed-algorithm">
      <p> If the UA becomes able or unable to use Bluetooth,
        for example because a radio was physically attached or detached,
        or the user has changed
        their <a href="#override-availability">configuration</a> for
        the answer returned from <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑥">getAvailability()</a></code>,
        the UA must <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task③">queue a task</a> on
        each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object">global object</a> <var>global</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event loop</a> to run the following steps: </p>
      <ol>
       <li> Let <var>oldAvailability</var> be
          the value <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑦">getAvailability()</a></code> would have returned before the change. 
       <li> Let <var>newAvailability</var> be
          the value <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑧">getAvailability()</a></code> would return after the change. 
       <li> If <var>oldAvailability</var> is not the same as <var>newAvailability</var>, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged②">availabilitychanged</a></code> using the <code class="idl"><a data-link-type="idl" href="#valueevent" id="ref-for-valueevent">ValueEvent</a></code> interface
          at <code><var>global</var>.navigator.bluetooth</code> with its <code class="idl"><a data-link-type="idl" href="#dom-valueevent-value" id="ref-for-dom-valueevent-value">value</a></code> attribute initialized to <var>newAvailability</var>. 
      </ol>
     </div>
<pre class="idl highlight def">[
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=<c- n>Window</c->,
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>
]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="valueevent"><code><c- g>ValueEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event"><c- n>Event</c-></a> {
  <dfn class="idl-code" data-dfn-for="ValueEvent" data-dfn-type="constructor" data-export data-lt="ValueEvent(type, initDict)|constructor(type, initDict)|ValueEvent(type)|constructor(type)" id="dom-valueevent-valueevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-valueevent-valueevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ValueEvent/ValueEvent(type, initDict), ValueEvent/constructor(type, initDict), ValueEvent/ValueEvent(type), ValueEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-valueevent-valueevent-type-initdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-valueevent-valueevent-type-initdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-valueeventinit" id="ref-for-dictdef-valueeventinit"><c- n>ValueEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ValueEvent/ValueEvent(type, initDict), ValueEvent/constructor(type, initDict), ValueEvent/ValueEvent(type), ValueEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-valueevent-valueevent-type-initdict-initdict"><code><c- g>initDict</c-></code><a class="self-link" href="#dom-valueevent-valueevent-type-initdict-initdict"></a></dfn> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#dom-valueevent-value" id="ref-for-dom-valueevent-value①"><c- g>value</c-></a>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-valueeventinit"><code><c- g>ValueEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit"><c- n>EventInit</c-></a> {
  <c- b>any</c-> <dfn class="idl-code" data-default="null" data-dfn-for="ValueEventInit" data-dfn-type="dict-member" data-export data-type="any " id="dom-valueeventinit-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-valueeventinit-value"></a></dfn> = <c- b>null</c->;
};
</pre>
     <p> <code class="idl"><a data-link-type="idl" href="#valueevent" id="ref-for-valueevent①">ValueEvent</a></code> instances are constructed
      as specified in <a href="https://dom.spec.whatwg.org/#constructing-events">DOM §2.5 Constructing events</a>. </p>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="ValueEvent" data-dfn-type="attribute" data-export id="dom-valueevent-value"><code>value</code></dfn> attribute
      must return the value it was initialized to. </p>
     <p class="issue" id="ValueEvent-too-generic"><a class="self-link" href="#ValueEvent-too-generic"></a> Such a generic event type belongs in <a data-link-type="biblio" href="#biblio-html">[HTML]</a> or <a data-link-type="biblio" href="#biblio-dom">[DOM]</a>, not here. </p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="4" id="device-representation"><span class="secno">4. </span><span class="content">Device Representation</span><a class="self-link" href="#device-representation"></a></h2>
    <p> The UA needs to track Bluetooth device properties at several levels:
    globally, per origin, and per <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object①">global object</a>. </p>
    <section>
     <h3 class="heading settled" data-level="4.1" id="global-device-properties"><span class="secno">4.1. </span><span class="content">Global Bluetooth device properties</span><a class="self-link" href="#global-device-properties"></a></h3>
     <p> The physical Bluetooth device may be guaranteed to have
      some properties that the UA may not have received.
      Those properties are described as optional here. </p>
     <p> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="bluetooth-device">Bluetooth device</dfn> has the following properties.
      Optional properties are not present, and sequence and map properties are empty,
      unless/until described otherwise.
      Other properties have a default specified or are specified when a device is introduced. </p>
     <ul>
      <li> A set of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="supported-physical-transports">supported physical transports</dfn>,
        including one or both of BR/EDR and LE.
        This set will generally be filled based on
        the transports over which the device was discovered
        and the <a data-link-type="dfn" href="#flags-data-type" id="ref-for-flags-data-type">Flags Data Type</a> in the <a data-link-type="dfn" href="#advertising-data" id="ref-for-advertising-data">Advertising Data</a> or <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response②">Extended Inquiry Response</a>. 
      <li> One or more of several kinds of 48-bit address:
        a <a data-link-type="dfn" href="#public-bluetooth-address" id="ref-for-public-bluetooth-address">Public Bluetooth Address</a>, a (random) <a data-link-type="dfn" href="#static-address" id="ref-for-static-address">Static Address</a>,
        and a resolvable or non-resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address①">Private Address</a>. 
      <li>An optional 128-bit <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key②">Identity Resolving Key</a>.
      <li> An optional partial or complete <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑥">Bluetooth Device Name</a>.
        A device has a partial name when the <a data-link-type="dfn" href="https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile#" id="termref-for-⑥">Shortened Local Name</a> AD data was received,
        but the full name hasn’t been read yet.
        The <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑦">Bluetooth Device Name</a> is encoded as UTF-8 and
        converted to a DOMString using the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom">utf-8 decode without BOM</a> algorithm. 
      <li> An optional <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer①">ATT Bearer</a>, over which all GATT communication happens.
        The <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer②">ATT Bearer</a> is created by procedures described in
        "Connection Establishment" under <a data-link-type="dfn" href="#gap-interoperability-requirements" id="ref-for-gap-interoperability-requirements">GAP Interoperability Requirements</a>.
        It is disconnected in ways <a data-link-type="biblio" href="#biblio-bluetooth42">[BLUETOOTH42]</a> isn’t entirely clear about. 
      <li> A list of advertised <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type①">Service UUIDs</a> from the <a data-link-type="dfn" href="#advertising-data" id="ref-for-advertising-data①">Advertising Data</a> or <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response③">Extended Inquiry Response</a>. 
      <li> A hierarchy of GATT <a data-link-type="dfn" href="#attribute" id="ref-for-attribute">Attributes</a>. 
     </ul>
     <p> The UA SHOULD determine that
      two <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⓪">Bluetooth device</a>s are
      the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="same device" id="same-bluetooth-device">same Bluetooth device</dfn> if and only if
      they have the same <a data-link-type="dfn" href="#public-bluetooth-address" id="ref-for-public-bluetooth-address①">Public Bluetooth Address</a>, <a data-link-type="dfn" href="#static-address" id="ref-for-static-address①">Static Address</a>, <a data-link-type="dfn" href="#private-address" id="ref-for-private-address②">Private Address</a>, or <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key③">Identity Resolving Key</a>,
      or if the <a data-link-type="dfn" href="#resolvable-private-address-resolution-procedure" id="ref-for-resolvable-private-address-resolution-procedure①">Resolvable Private Address Resolution Procedure</a> succeeds using
      one device’s IRK and the other’s Resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address③">Private Address</a>.
      However, because platform APIs don’t document how they determine device identity,
      the UA MAY use another procedure. </p>
    </section>
    <section>
     <h3 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="4.2" data-lt="BluetoothDevice" id="bluetoothdevice"><span class="secno">4.2. </span><span class="content">BluetoothDevice</span></h3>
     <p> A <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⓪">BluetoothDevice</a></code> instance represents a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①①">Bluetooth device</a> for a particular <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object②">global object</a> (or, equivalently, for a particular <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms②">Realm</a> or <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑤">Bluetooth</a></code> instance). </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothdevice" id="ref-for-bluetoothdevice①①"><c- g>BluetoothDevice</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id②"><c- g>id</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑦"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothdevice-name" id="ref-for-dom-bluetoothdevice-name"><c- g>name</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver"><c- n>BluetoothRemoteGATTServer</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTServer?" href="#dom-bluetoothdevice-gatt" id="ref-for-dom-bluetoothdevice-gatt"><c- g>gatt</c-></a>;

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements"><c- g>watchAdvertisements</c-></a>();
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-unwatchadvertisements" id="ref-for-dom-bluetoothdevice-unwatchadvertisements"><c- g>unwatchAdvertisements</c-></a>();
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements"><c- g>watchingAdvertisements</c-></a>;
};
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①②"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers①"><c- n>BluetoothDeviceEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①③"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers①"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①④"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers①"><c- n>ServiceEventHandlers</c-></a>;
</pre>
     <div class="note no-marker" role="note">
      <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑤">BluetoothDevice</a></code> attributes</div>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-id"><code>id</code></dfn> uniquely identifies a device to the extent that
        the UA can determine that two Bluetooth connections are to the same device
        and to the extent that
        the user <a href="#note-device-id-tracking">wants to expose that fact to script</a>. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-name"><code>name</code></dfn> is the human-readable name of the device. </p>
      <p> <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-gatt" id="ref-for-dom-bluetoothdevice-gatt①">gatt</a></code> provides a way to interact with this device’s GATT server
        if the site has permission to do so. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-watchingadvertisements"><code>watchingAdvertisements</code></dfn> is true if
        the UA is currently scanning for advertisements from this device
        and firing events for them. </p>
     </div>
     <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑥">BluetoothDevice</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots③">internal slots</a> described in the following table: </p>
     <table class="data">
      <thead>
       <tr>
        <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots④">Internal Slot</a>
        <th>Initial Value
        <th>Description (non-normative)
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-context-slot"><code>[[context]]</code></dfn>
        <td>&lt;always set in prose>
        <td> The <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑥">Bluetooth</a></code> object that returned this <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑦">BluetoothDevice</a></code>. 
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-representeddevice-slot"><code>[[representedDevice]]</code></dfn>
        <td>&lt;always set in prose>
        <td> The <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①②">Bluetooth device</a> this object represents,
          or <code>null</code> if access has been <a data-link-type="dfn" href="#revoke-bluetooth-access" id="ref-for-revoke-bluetooth-access①">revoked</a>. 
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-gatt-slot"><code>[[gatt]]</code></dfn>
        <td> a new <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①">BluetoothRemoteGATTServer</a></code> instance with
          its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-device" id="ref-for-dom-bluetoothremotegattserver-device">device</a></code> attribute initialized to <code>this</code> and its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected">connected</a></code> attribute initialized to <code>false</code>. 
        <td> Does not change. 
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-allowedservices-slot"><code>[[allowedServices]]</code></dfn>
        <td>&lt;always set in prose>
        <td> This device’s <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices③">allowedServices</a></code> list for this origin
          or <code>"all"</code> if all services are allowed.
          For example, a UA may grant an origin access to all services on
          a <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice③">referringDevice</a></code> that advertised a URL on that origin. 
     </table>
     <div class="algorithm" data-algorithm="get the BluetoothDevice representing">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="get-the-bluetoothdevice-representing">get the <code>BluetoothDevice</code> representing</dfn> a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①③">Bluetooth device</a> <var>device</var> inside a <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑦">Bluetooth</a></code> instance <var>context</var>,
        the UA MUST run the following steps: </p>
      <ol>
       <li> Let <var>data</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondata" id="ref-for-dictdef-bluetoothpermissiondata③">BluetoothPermissionData</a></code>,
          be <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth⑤">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data④">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object③">current settings object</a>. 
       <li> Find the <var>allowedDevice</var> in <code><var>data</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices③">allowedDevices</a></code></code> with <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot④">[[device]]</a></code></code> the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device①">same device</a> as <var>device</var>.
          If there is no such object,
          throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror③">SecurityError</a></code> and abort these steps. 
       <li>
         If there is no key in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot">[[deviceInstanceMap]]</a></code> that is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device②">same device</a> as <var>device</var>,
          run the following sub-steps: 
        <ol>
         <li>Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑧">BluetoothDevice</a></code>.
         <li>Initialize all of <var>result</var>’s optional fields to <code>null</code>.
         <li> Initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot">[[context]]</a></code></code> to <var>context</var>. 
         <li> Initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot②">[[representedDevice]]</a></code></code> to <var>device</var>. 
         <li> Initialize <code><var>result</var>.id</code> to <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid③">deviceId</a></code></code>,
              and initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①">[[allowedServices]]</a></code></code> to <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices④">allowedServices</a></code></code>. 
         <li> If <var>device</var> has a partial or complete <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑧">Bluetooth Device Name</a>,
              set <code><var>result</var>.name</code> to that string. 
         <li> Initialize <code><var>result</var>.watchingAdvertisements</code> to <code>false</code>. 
         <li> Add a mapping from <var>device</var> to <var>result</var> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot①">[[deviceInstanceMap]]</a></code>. 
        </ol>
       <li> Return the value in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot②">[[deviceInstanceMap]]</a></code> whose key is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device③">same device</a> as <var>device</var>. 
      </ol>
     </div>
     <div class="algorithm" data-algorithm="gatt">
      <p> Getting the <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-gatt"><code>gatt</code></dfn></code> attribute
        MUST perform the following steps: </p>
      <ol>
       <li> If <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth⑥">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data⑤">extra permission data</a> for <code>this</code>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a> has an <code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice③">AllowedBluetoothDevice</a></code> <var>allowedDevice</var> in its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices④">allowedDevices</a></code> list
          with <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot⑤">[[device]]</a></code></code> the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device④">same device</a> as <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot③">[[representedDevice]]</a></code></code> and <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt②">mayUseGATT</a></code></code> equal to <code>true</code>,
          return <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-gatt-slot" id="ref-for-dom-bluetoothdevice-gatt-slot">[[gatt]]</a></code></code>. 
       <li> Otherwise, return <code>null</code>. 
      </ol>
     </div>
     <p class="note" role="note"> Scanning costs power,
      so websites should avoid watching for advertisements unnecessarily,
      and should call <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-unwatchadvertisements" id="ref-for-dom-bluetoothdevice-unwatchadvertisements①">unwatchAdvertisements()</a></code> to stop using power as soon as possible. </p>
     <div class="unstable algorithm" data-algorithm="watchAdvertisements()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="method" data-export id="dom-bluetoothdevice-watchadvertisements"><code>watchAdvertisements()</code></dfn></code> method,
        when invoked,
        MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise②">a new promise</a> <var>promise</var> and
        run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a>: </p>
      <ol>
       <li> Ensure that the UA is scanning for this device’s advertisements.
          The UA SHOULD NOT filter out "duplicate" advertisements for the same device. 
       <li>
         If the UA fails to enable scanning, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise③">reject</a> <var>promise</var> with one of the following errors,
          and abort these steps: 
        <dl class="switch">
         <dt>The UA doesn’t support scanning for advertisements
         <dd><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror">NotSupportedError</a></code>
         <dt>Bluetooth is turned off
         <dd><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code>
         <dt>Other reasons
         <dd><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#unknownerror" id="ref-for-unknownerror">UnknownError</a></code>
        </dl>
       <li>
         <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task④">Queue a task</a> to perform the following steps: 
        <ol>
         <li>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements①">watchingAdvertisements</a></code></code> to <code>true</code>.
         <li>Resolve <var>promise</var> with <code>undefined</code>.
        </ol>
      </ol>
     </div>
     <div class="unstable algorithm" data-algorithm="unwatchAdvertisements()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="method" data-export id="dom-bluetoothdevice-unwatchadvertisements"><code>unwatchAdvertisements()</code></dfn></code> method,
        when invoked,
        MUST run the following steps: </p>
      <ol>
       <li>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements②">watchingAdvertisements</a></code></code> to <code>false</code>.
       <li> If no more <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑨">BluetoothDevice</a></code>s in the whole UA
          have <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements③">watchingAdvertisements</a></code> set to <code>true</code>,
          the UA SHOULD stop scanning for advertisements.
          Otherwise, if no more <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⓪">BluetoothDevice</a></code>s representing the same device as <code>this</code> have <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements④">watchingAdvertisements</a></code> set to <code>true</code>,
          the UA SHOULD reconfigure the scan to avoid receiving reports for this device. 
      </ol>
     </div>
     <section class="unstable">
      <h4 class="heading settled" data-level="4.2.1" id="advertising-events"><span class="secno">4.2.1. </span><span class="content">Responding to Advertising Events</span><a class="self-link" href="#advertising-events"></a></h4>
      <p> When an <a data-link-type="dfn" href="#advertising-event" id="ref-for-advertising-event">advertising event</a> arrives for a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②①">BluetoothDevice</a></code> with <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements⑤">watchingAdvertisements</a></code> set,
        the UA delivers an "<code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-advertisementreceived" id="ref-for-eventdef-bluetoothdevice-advertisementreceived">advertisementreceived</a></code>" event. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap"><c- g>BluetoothManufacturerDataMap</c-></a> {
  <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①"><c- b>DataView</c-></a>>;
};
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap"><c- g>BluetoothServiceDataMap</c-></a> {
  <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①"><c- n>UUID</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor②"><c- b>DataView</c-></a>>;
};
[
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑥"><c- g>Exposed</c-></a>=<c- n>Window</c->,
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤"><c- g>SecureContext</c-></a>
]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothadvertisingevent"><code><c- g>BluetoothAdvertisingEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①"><c- n>Event</c-></a> {
  <a class="idl-code" data-link-type="constructor" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent" id="ref-for-dom-bluetoothadvertisingevent-bluetoothadvertisingevent"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑧"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEvent/BluetoothAdvertisingEvent(type, init), BluetoothAdvertisingEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"></a></dfn>, <a class="n" data-link-type="idl-name" href="#dictdef-bluetoothadvertisingeventinit" id="ref-for-dictdef-bluetoothadvertisingeventinit"><c- n>BluetoothAdvertisingEventInit</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEvent/BluetoothAdvertisingEvent(type, init), BluetoothAdvertisingEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"><code><c- g>init</c-></code><a class="self-link" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②②"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid②"><c- n>UUID</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<UUID>" href="#dom-bluetoothadvertisingevent-uuids" id="ref-for-dom-bluetoothadvertisingevent-uuids"><c- g>uuids</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑨"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothadvertisingevent-name" id="ref-for-dom-bluetoothadvertisingevent-name"><c- g>name</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short①"><c- b>unsigned</c-> <c- b>short</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned short?" href="#dom-bluetoothadvertisingevent-appearance" id="ref-for-dom-bluetoothadvertisingevent-appearance"><c- g>appearance</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-txpower" id="ref-for-dom-bluetoothadvertisingevent-txpower"><c- g>txPower</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte①"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-rssi" id="ref-for-dom-bluetoothadvertisingevent-rssi"><c- g>rssi</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap①"><c- n>BluetoothManufacturerDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothManufacturerDataMap" href="#dom-bluetoothadvertisingevent-manufacturerdata" id="ref-for-dom-bluetoothadvertisingevent-manufacturerdata"><c- g>manufacturerData</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap①"><c- n>BluetoothServiceDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothServiceDataMap" href="#dom-bluetoothadvertisingevent-servicedata" id="ref-for-dom-bluetoothadvertisingevent-servicedata"><c- g>serviceData</c-></a>;
};
<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothadvertisingeventinit"><code><c- g>BluetoothAdvertisingEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①"><c- n>EventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②③"><c- n>BluetoothDevice</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothDevice " id="dom-bluetoothadvertisingeventinit-device"><code><c- g>device</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-device"></a></dfn>;
  <c- b>sequence</c->&lt;(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⓪"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>)> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="sequence<(DOMString or unsigned long)> " id="dom-bluetoothadvertisingeventinit-uuids"><code><c- g>uuids</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-bluetoothadvertisingeventinit-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-name"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short②"><c- b>unsigned</c-> <c- b>short</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="unsigned short " id="dom-bluetoothadvertisingeventinit-appearance"><code><c- g>appearance</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-appearance"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte②"><c- b>byte</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="byte " id="dom-bluetoothadvertisingeventinit-txpower"><code><c- g>txPower</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-txpower"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte③"><c- b>byte</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="byte " id="dom-bluetoothadvertisingeventinit-rssi"><code><c- g>rssi</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-rssi"></a></dfn>;
  <a class="n" data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap②"><c- n>BluetoothManufacturerDataMap</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothManufacturerDataMap " id="dom-bluetoothadvertisingeventinit-manufacturerdata"><code><c- g>manufacturerData</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap②"><c- n>BluetoothServiceDataMap</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothServiceDataMap " id="dom-bluetoothadvertisingeventinit-servicedata"><code><c- g>serviceData</c-></code></dfn>;
};
</pre>
      <div class="note no-marker" data-link-for-hint="BluetoothAdvertisingEvent" role="note">
       <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent">BluetoothAdvertisingEvent</a></code> attributes</div>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-device"><code>device</code></dfn> is the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②④">BluetoothDevice</a></code> that sent this advertisement. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-uuids"><code>uuids</code></dfn> lists the Service UUIDs that
          this advertisement says <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device①">device</a></code>'s GATT server supports. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-name"><code>name</code></dfn> is <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device②">device</a></code>'s local name, or a prefix of it. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-appearance"><code>appearance</code></dfn> is an <a data-link-type="dfn" href="#appearance" id="ref-for-appearance">Appearance</a>, one of the values defined by
          the <code class="idl"><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml#" id="termref-for-⑦">org.bluetooth.characteristic.gap.appearance</a></code> characteristic. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-txpower"><code>txPower</code></dfn> is
          the transmission power at which the device is broadcasting, measured in dBm.
          This is used to compute the path loss as <code>this.txPower - this.rssi</code>. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-rssi"><code>rssi</code></dfn> is
          the power at which the advertisement was received, measured in dBm.
          This is used to compute the path loss as <code>this.txPower - this.rssi</code>. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-manufacturerdata"><code>manufacturerData</code></dfn> maps <code>unsigned short</code> Company Identifier Codes
          to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor③">DataView</a></code>s. </p>
       <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-servicedata"><code>serviceData</code></dfn> maps <code class="idl"><a data-link-type="idl" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid③">UUID</a></code>s to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor④">DataView</a></code>s. </p>
      </div>
      <div class="example" id="example-interpret-ibeacon">
       <a class="self-link" href="#example-interpret-ibeacon"></a> 
       <p> To retrieve a device and read the iBeacon data out of it,
          a developer could use the following code.
          Note that this API currently doesn’t provide a way
          to request devices with certain manufacturer data,
          so the iBeacon will need to rotate its advertisements to include a known service
          in order for users to select this device in the <code>requestDevice</code> dialog. </p>
<pre class="highlight"><c- a>var</c-> known_service <c- o>=</c-> <c- u>"A service in the iBeacon’s GATT server"</c-><c- p>;</c->
<c- k>return</c-> navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c->
  filters<c- o>:</c-> <c- p>[{</c->services<c- o>:</c-> <c- p>[</c->known_service<c- p>]}]</c->
<c- p>}).</c->then<c- p>(</c->device <c- p>=></c-> <c- p>{</c->
  device<c- p>.</c->watchAdvertisements<c- p>();</c->
  device<c- p>.</c->addEventListener<c- p>(</c-><c- t>'advertisementreceived'</c-><c- p>,</c-> interpretIBeacon<c- p>);</c->
<c- p>});</c->

<c- a>function</c-> interpretIBeacon<c- p>(</c->event<c- p>)</c-> <c- p>{</c->
  <c- a>var</c-> rssi <c- o>=</c-> event<c- p>.</c->rssi<c- p>;</c->
  <c- a>var</c-> appleData <c- o>=</c-> event<c- p>.</c->manufacturerData<c- p>.</c->get<c- p>(</c-><a href="https://www.bluetooth.org/en-us/specification/assigned-numbers/company-identifiers" title="Apple, Inc.&apos;s Company Identifier"><c- mh>0x004C</c-></a><c- p>);</c->
  <c- k>if</c-> <c- p>(</c->appleData<c- p>.</c->byteLength <c- o>!=</c-> <c- mi>23</c-> <c- o>||</c->
    appleData<c- p>.</c->getUint16<c- p>(</c-><c- mi>0</c-><c- p>,</c-> <c- kc>false</c-><c- p>)</c-> <c- o>!==</c-> <c- mh>0x0215</c-><c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>({</c->isBeacon<c- o>:</c-> <c- kc>false</c-><c- p>});</c->
  <c- p>}</c->
  <c- a>var</c-> uuidArray <c- o>=</c-> <c- k>new</c-> Uint8Array<c- p>(</c->appleData<c- p>.</c->buffer<c- p>,</c-> <c- mi>2</c-><c- p>,</c-> <c- mi>16</c-><c- p>);</c->
  <c- a>var</c-> major <c- o>=</c-> appleData<c- p>.</c->getUint16<c- p>(</c-><c- mi>18</c-><c- p>,</c-> <c- kc>false</c-><c- p>);</c->
  <c- a>var</c-> minor <c- o>=</c-> appleData<c- p>.</c->getUint16<c- p>(</c-><c- mi>20</c-><c- p>,</c-> <c- kc>false</c-><c- p>);</c->
  <c- a>var</c-> txPowerAt1m <c- o>=</c-> <c- o>-</c->appleData<c- p>.</c->getInt8<c- p>(</c-><c- mi>22</c-><c- p>);</c->
  console<c- p>.</c->log<c- p>({</c->
      isBeacon<c- o>:</c-> <c- kc>true</c-><c- p>,</c->
      uuidArray<c- p>,</c->
      major<c- p>,</c->
      minor<c- p>,</c->
      pathLossVs1m<c- o>:</c-> txPowerAt1m <c- o>-</c-> rssi<c- p>});</c->
<c- p>});</c->
</pre>
       <p> The format of iBeacon advertisements was derived from <a href="http://www.warski.org/blog/2014/01/how-ibeacons-work/">How do iBeacons work?</a> by Adam Warski. </p>
      </div>
      <div class="algorithm" data-algorithm="received advertising event" id="advertising-event-algorithm">
       <p> When the UA receives an <a data-link-type="dfn" href="#advertising-event" id="ref-for-advertising-event①">advertising event</a> (consisting of an advertising packet and an optional scan response),
          it MUST run the following steps: </p>
       <ol>
        <li> Let <var>device</var> be the <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①④">Bluetooth device</a> that sent the advertising event. 
        <li>
          For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑤">BluetoothDevice</a></code> <var>deviceObj</var> in the UA
            such that <var>device</var> is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑤">same device</a> as <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot④">[[representedDevice]]</a></code></code>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑤">queue a task</a> on <var>deviceObj</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①">responsible event loop</a> to do the following sub-steps: 
         <ol>
          <li> If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements⑥">watchingAdvertisements</a></code></code> is <code>false</code>,
                abort these sub-steps. 
          <li> <a data-link-type="dfn" href="#fire-an-advertisementreceived-event" id="ref-for-fire-an-advertisementreceived-event">Fire an <code>advertisementreceived</code> event</a> for the advertising event at <var>deviceObj</var>. 
         </ol>
       </ol>
      </div>
      <div class="algorithm" data-algorithm="fire an advertisementreceived event">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fire-an-advertisementreceived-event">fire an <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-advertisementreceived" id="ref-for-eventdef-bluetoothdevice-advertisementreceived①">advertisementreceived</a></code> event</dfn> for an advertising event <var>adv</var> at a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑥">BluetoothDevice</a></code> <var>deviceObj</var>,
          the UA MUST perform the following steps: </p>
       <ol>
        <li>
          Let <var>event</var> be 
<pre class="highlight"><c- p>{</c->
  bubbles<c- o>:</c-> <c- kc>true</c-><c- p>,</c->
  device<c- o>:</c-> <var>deviceObj</var><c- p>,</c->
  uuids<c- o>:</c-> <c- p>[],</c->
  manufacturerData<c- o>:</c-> <c- k>new</c-> Map<c- p>(),</c->
  serviceData<c- o>:</c-> <c- k>new</c-> Map<c- p>()</c->
<c- p>}</c->
</pre>
        <li> If the <a data-link-type="dfn" href="#rssi" id="ref-for-rssi">received signal strength</a> is available
            for any packet in <var>adv</var>,
            set <code><var>event</var>.rssi</code> to this signal strength in dBm. 
        <li>
          For each <a data-link-type="dfn" href="#ad-structure" id="ref-for-ad-structure">AD structure</a> in <var>adv</var>’s advertising packet and scan response,
            select from the following steps depending on the AD type: 
         <dl class="switch">
          <dt>Incomplete List of 16-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type②">Service UUIDs</a>
          <dt>Complete List of 16-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type③">Service UUIDs</a>
          <dt>Incomplete List of 32-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type④">Service UUIDs</a>
          <dt>Complete List of 32-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑤">Service UUIDs</a>
          <dt>Incomplete List of 128-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑥">Service UUIDs</a>
          <dt>Complete List of 128-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑦">Service UUIDs</a>
          <dd>Append the listed UUIDs to <code><var>event</var>.uuids</code>.
          <dt>Shortened <a data-link-type="dfn" href="#local-name-data-type" id="ref-for-local-name-data-type">Local Name</a>
          <dt>Complete <a data-link-type="dfn" href="#local-name-data-type" id="ref-for-local-name-data-type①">Local Name</a>
          <dd>
            <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom①">UTF-8 decode without BOM</a> the AD data and
                set <code><var>event</var>.name</code> to the result. 
           <p class="note" role="note"><span>Note:</span> We don’t expose whether the name is complete
                because existing APIs require
                reading the raw advertisement to get this information,
                and we want more evidence that it’s useful
                before adding a field to the API.</p>
          <dt><a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data③">Manufacturer Specific Data</a>
          <dd> Add to <code><var>event</var>.manufacturerData</code> a mapping from the 16-bit Company Identifier Code to
                an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor">ArrayBuffer</a></code> containing the manufacturer-specific data. 
          <dt><a data-link-type="dfn" href="#tx-power-level" id="ref-for-tx-power-level">TX Power Level</a>
          <dd> Set <code><var>event</var>.txPower</code> to the AD data. 
          <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data③">Service Data</a> - 16 bit UUID
          <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data④">Service Data</a> - 32 bit UUID
          <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data⑤">Service Data</a> - 128 bit UUID
          <dd> Add to <code><var>event</var>.serviceData</code> a mapping from the <a data-link-type="dfn" href="#uuid" id="ref-for-uuid①">UUID</a> to
                an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor①">ArrayBuffer</a></code> containing the service data. 
          <dt><a data-link-type="dfn" href="#appearance" id="ref-for-appearance①">Appearance</a>
          <dd> Set <code><var>event</var>.appearance</code> to the AD data. 
          <dt>Otherwise
          <dd>Skip to the next AD structure.
         </dl>
        <li> <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire①">Fire an event</a> initialized as <code>new <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent①">BluetoothAdvertisingEvent</a></code>("<code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-advertisementreceived" id="ref-for-eventdef-bluetoothdevice-advertisementreceived②">advertisementreceived</a></code>", <var>event</var>)</code>,
            with its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-istrusted" id="ref-for-dom-event-istrusted">isTrusted</a></code> attribute initialized to <code>true</code>,
            at <var>deviceObj</var>. 
       </ol>
      </div>
      <p> All fields in <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent②">BluetoothAdvertisingEvent</a></code> return
        the last value they were initialized or set to. </p>
      <div class="algorithm" data-algorithm="BluetoothAdvertisingEvent(type, init)">
       <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="constructor" data-export data-lt="BluetoothAdvertisingEvent(type, init)|constructor(type, init)" id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent"><code>BluetoothAdvertisingEvent(type, init)</code></dfn> constructor MUST perform the following steps: </p>
       <ol>
        <li> Let <var>event</var> be the result of running the steps from <a href="https://dom.spec.whatwg.org/#constructing-events">DOM §2.5 Constructing events</a> except for the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-uuids" id="ref-for-dom-bluetoothadvertisingeventinit-uuids">uuids</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-manufacturerdata" id="ref-for-dom-bluetoothadvertisingeventinit-manufacturerdata">manufacturerData</a></code>,
            and <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-servicedata" id="ref-for-dom-bluetoothadvertisingeventinit-servicedata">serviceData</a></code> members. 
        <li> If <code><var>init</var>.uuids</code> is set,
            initialize <code><var>event</var>.uuids</code> to a new <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array③">FrozenArray</a></code> containing the elements of <code><var>init</var>.uuids.map(<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑤">BluetoothUUID.getService</a></code>)</code>.
            Otherwise initialize <code><var>event</var>.uuids</code> to an empty <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array④">FrozenArray</a></code>. 
        <li>
          For each mapping in <code><var>init</var>.manufacturerData</code>: 
         <ol>
          <li> Let <var>code</var> be the key converted to an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short③">unsigned short</a></code>. 
          <li> Let <var>value</var> be the value. 
          <li> If <var>value</var> is not a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource②">BufferSource</a></code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①②">TypeError</a></code>. 
          <li> Let <var>bytes</var> be a new <a data-link-type="dfn" href="#read-only-arraybuffer" id="ref-for-read-only-arraybuffer">read only ArrayBuffer</a> containing <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy④">a copy of the bytes held</a> by <var>value</var>. 
          <li> Add a mapping from <var>code</var> to <code>new DataView(<var>bytes</var>)</code> in <code><var>event</var>.manufacturerData.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatamap-backingmap-slot" id="ref-for-dom-bluetoothmanufacturerdatamap-backingmap-slot">[[BackingMap]]</a></code></code>. 
         </ol>
        <li>
          For each mapping in <code><var>init</var>.serviceData</code>: 
         <ol>
          <li> Let <var>key</var> be the key. 
          <li> Let <var>service</var> be the result of calling <code>BluetoothUUID.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑥">getService</a></code>(<var>key</var>).</code> 
          <li> Let <var>value</var> be the value. 
          <li> Set <var>value</var> is not a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource③">BufferSource</a></code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①③">TypeError</a></code>. 
          <li> Let <var>bytes</var> be a new <a data-link-type="dfn" href="#read-only-arraybuffer" id="ref-for-read-only-arraybuffer①">read only ArrayBuffer</a> containing <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑤">a copy of the bytes held</a> by <var>value</var>. 
          <li> Add a mapping from <var>service</var> to <code>new DataView(<var>bytes</var>)</code> in <code><var>event</var>.serviceData.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothservicedatamap-backingmap-slot" id="ref-for-dom-bluetoothservicedatamap-backingmap-slot">[[BackingMap]]</a></code></code>. 
         </ol>
        <li>Return <var>event</var>.
       </ol>
      </div>
      <section>
       <h5 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="4.2.1.1" data-lt="BluetoothManufacturerDataMap" id="bluetoothmanufacturerdatamap"><span class="secno">4.2.1.1. </span><span class="content">BluetoothManufacturerDataMap</span></h5>
       <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap③">BluetoothManufacturerDataMap</a></code> have a <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothManufacturerDataMap" data-dfn-type="attribute" data-export id="dom-bluetoothmanufacturerdatamap-backingmap-slot"><code>[[BackingMap]]</code></dfn> slot because they are <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-maplike" id="ref-for-dfn-maplike">maplike</a>, which maps manufacturer codes to
          the manufacturer’s data, converted to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑤">DataView</a></code>s. </p>
      </section>
      <section>
       <h5 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="4.2.1.2" data-lt="BluetoothServiceDataMap" id="bluetoothservicedatamap"><span class="secno">4.2.1.2. </span><span class="content">BluetoothServiceDataMap</span></h5>
       <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap③">BluetoothServiceDataMap</a></code> have a <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothServiceDataMap" data-dfn-type="attribute" data-export id="dom-bluetoothservicedatamap-backingmap-slot"><code>[[BackingMap]]</code></dfn> slot because they are <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-maplike" id="ref-for-dfn-maplike①">maplike</a>, which maps service UUIDs to the
          service’s data, converted to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑥">DataView</a></code>s. </p>
      </section>
     </section>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="5" id="gatt-interaction"><span class="secno">5. </span><span class="content">GATT Interaction</span><a class="self-link" href="#gatt-interaction"></a></h2>
    <section id>
     <h3 class="heading settled" data-level="5.1" id="information-model"><span class="secno">5.1. </span><span class="content">GATT Information Model</span><a class="self-link" href="#information-model"></a></h3>
     <div class="note" role="note">
      <p> The <a data-link-type="dfn" href="#gatt-profile-hierarchy" id="ref-for-gatt-profile-hierarchy">GATT Profile Hierarchy</a> describes how a <a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver②">GATT Server</a> contains a hierarchy of Profiles, Primary <a data-link-type="dfn" href="#service" id="ref-for-service⑥">Service</a>s, <a data-link-type="dfn" href="#included-service" id="ref-for-included-service">Included Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic②">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor②">Descriptor</a>s. </p>
      <p> Profiles are purely logical:
        the specification of a Profile describes the expected interactions between
        the other GATT entities the Profile contains,
        but it’s impossible to query which Profiles a device supports. </p>
      <p> <a data-link-type="dfn" href="#gatt-client" id="ref-for-gatt-client">GATT Client</a>s can discover and interact with
        the Services, Characteristics, and Descriptors on a device
        using a set of <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure">GATT procedures</a>.
        This spec refers to Services, Characteristics, and Descriptors
        collectively as <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute">Attribute</dfn>s.
        All Attributes have a type that’s identified by a <a data-link-type="dfn" href="#uuid" id="ref-for-uuid②">UUID</a>.
        Each Attribute also has a 16-bit <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle">Attribute Handle</a> that distinguishes it from other Attributes
        of the same type on the same <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server②">GATT Server</a>.
        Attributes are notionally ordered within their <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server③">GATT Server</a> by their <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle①">Attribute Handle</a>,
        but while platform interfaces provide attributes in some order,
        they do not guarantee that it’s consistent with the <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle②">Attribute Handle</a> order. </p>
      <p data-link-for-hint="BluetoothRemoteGATTService"> A <a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①">Service</a> contains
        a collection of <a data-link-type="idl" href="#dom-bluetoothremotegattservice-getincludedservice" id="ref-for-dom-bluetoothremotegattservice-getincludedservice">Included Service</a>s
        and <a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic③">Characteristic</a>s.
        The Included Services are references to other Services,
        and a single Service can be included by more than one other Service.
        Services are known as <a data-link-type="idl" href="#dom-bluetoothremotegattservice-isprimary" id="ref-for-dom-bluetoothremotegattservice-isprimary">Primary Services</a> if they appear directly under the <a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver③">GATT Server</a>,
        and Secondary Services if they’re only included by other Services,
        but Primary Services can also be included. </p>
      <p data-link-for-hint="BluetoothRemoteGATTCharacteristic"> A <a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②">Characteristic</a> contains a value, which is an array of bytes,
        and a collection of <a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-getdescriptor" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor">Descriptor</a>s.
        Depending on the <a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties">properties</a> of the Characteristic,
        a <a data-link-type="dfn" href="#gatt-client" id="ref-for-gatt-client①">GATT Client</a> can read or write its value,
        or register to be notified when the value changes. </p>
      <p> Finally, a <a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①">Descriptor</a> contains a value (again an array of bytes)
        that describes or configures its <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic③">Characteristic</a>. </p>
     </div>
     <section>
      <h4 class="heading settled" data-level="5.1.1" id="persistence"><span class="secno">5.1.1. </span><span class="content">Persistence across connections</span><a class="self-link" href="#persistence"></a></h4>
      <p>The Bluetooth <a data-link-type="dfn" href="#attribute-caching" id="ref-for-attribute-caching">Attribute Caching</a> system allows <a data-link-type="dfn" href="#bond" id="ref-for-bond">bonded</a> clients
      to save references to attributes from one connection to the next.
      Web Bluetooth treats websites as <em>not</em> <a data-link-type="dfn" href="#bond" id="ref-for-bond①">bonded</a> to devices they have permission to access: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic③">BluetoothRemoteGATTCharacteristic</a></code>,
      and <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor②">BluetoothRemoteGATTDescriptor</a></code> objects
      become invalid on <a href="#disconnection-events">disconnection</a>,
      and the site must retrieved them again when it re-connects.</p>
     </section>
     <section>
      <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="5.1.2" data-lt="Bluetooth cache" data-noexport id="bluetooth-cache"><span class="secno">5.1.2. </span><span class="content">The Bluetooth cache</span></h4>
      <p> The UA MUST maintain a <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache②">Bluetooth cache</a> of the hierarchy of Services, Characteristics, and Descriptors
        it has discovered on a device.
        The UA MAY share this cache between multiple origins accessing the same device.
        Each potential entry in the cache is either known-present, known-absent, or unknown.
        The cache MUST NOT contain two entries that are for the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute">same attribute</a>.
        Each known-present entry in the cache is associated with an optional <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice③">BluetoothRemoteGATTService</a></code>></code>, <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic④">BluetoothRemoteGATTCharacteristic</a></code>></code>,
        or <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor③">BluetoothRemoteGATTDescriptor</a></code>></code> instance
        for each <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑧">Bluetooth</a></code> instance. </p>
      <p class="note" role="note"> For example, if a user calls the <code>serviceA.getCharacteristic(uuid1)</code> function
        with an initially empty <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache③">Bluetooth cache</a>,
        the UA uses the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid">Discover Characteristics by UUID</a> procedure
        to fill the needed cache entries,
        and the UA ends the procedure early because
        it only needs one Characteristic to fulfil the returned <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects③">Promise</a></code>,
        then the first Characteristic with UUID <code>uuid1</code> inside <code>serviceA</code> is known-present,
        and any subsequent Characteristics with that UUID remain unknown.
        If the user later calls <code>serviceA.getCharacteristics(uuid1)</code>,
        the UA needs to resume or restart the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid①">Discover Characteristics by UUID</a> procedure.
        If it turns out that <code>serviceA</code> only has one Characteristic with UUID <code>uuid1</code>,
        then the subsequent Characteristics become known-absent. </p>
      <p> The known-present entries in the <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache④">Bluetooth cache</a> are ordered:
        Primary Services appear in a particular order within a device,
        Included Services and Characteristics appear in a particular order within Services,
        and Descriptors appear in a particular order within Characteristics.
        The order SHOULD match the order of <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle③">Attribute Handle</a>s on the device,
        but UAs MAY use another order if the device’s order isn’t available. </p>
      <div class="algorithm" data-algorithm="populate the Bluetooth cache">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="populate-the-bluetooth-cache">populate the Bluetooth cache</dfn> with entries matching some description,
          the UA MUST run the following steps. <span class="note">Note that these steps can block,
            so uses of this algorithm must be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">in parallel</a>.</span> </p>
       <ol>
        <li> Attempt to make all matching entries in the cache either known-present or known-absent,
            using any sequence of <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure①">GATT procedures</a> that <a data-link-type="biblio" href="#biblio-bluetooth42">[BLUETOOTH42]</a> specifies
            will return enough information.
            Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
        <li> If the previous step returns an error, return that error from this algorithm. 
       </ol>
      </div>
      <div class="algorithm" data-algorithm="query the Bluetooth cache">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="query-the-bluetooth-cache">query the Bluetooth cache</dfn> in
          a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑦">BluetoothDevice</a></code> instance <var>deviceObj</var> for entries matching some description,
          the UA MUST return a <code><var>deviceObj</var>.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise③">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">in parallel</a>: </p>
       <ol>
        <li> <a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache②">Populate the Bluetooth cache</a> with entries matching the description. 
        <li> If the previous step returns an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise④">reject</a> <var>promise</var> with that error and abort these steps. 
        <li> Let <var>entries</var> be the sequence
            of known-present cache entries matching the description. 
        <li> Let <var>context</var> be <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot①">[[context]]</a></code></code>. 
        <li> Let <var>result</var> be a new sequence. 
        <li>
          For each <var>entry</var> in <var>entries</var>: 
         <ol>
          <li> If <var>entry</var> has no associated <code>Promise&lt;BluetoothGATT*></code> instance
                in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot">[[attributeInstanceMap]]</a></code>, <a data-link-type="dfn" href="#create-a-bluetoothremotegattservice-representing" id="ref-for-create-a-bluetoothremotegattservice-representing">create a <code>BluetoothRemoteGATTService</code> representing</a> <var>entry</var>, <a data-link-type="dfn" href="#create-a-bluetoothremotegattcharacteristic-representing" id="ref-for-create-a-bluetoothremotegattcharacteristic-representing">create a <code>BluetoothRemoteGATTCharacteristic</code> representing</a> <var>entry</var>,
                or <a data-link-type="dfn" href="#create-a-bluetoothremotegattdescriptor-representing" id="ref-for-create-a-bluetoothremotegattdescriptor-representing">create a <code>BluetoothRemoteGATTDescriptor</code> representing</a> <var>entry</var>,
                depending on whether <var>entry</var> is a Service, Characteristic, or Descriptor,
                and add a mapping from <var>entry</var> to the resulting <code>Promise</code> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot①">[[attributeInstanceMap]]</a></code>. 
          <li> Append to <var>result</var> the <code>Promise&lt;BluetoothGATT*></code> instance
                associated with <var>entry</var> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot②">[[attributeInstanceMap]]</a></code>. 
         </ol>
        <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#waiting-for-all" id="ref-for-waiting-for-all">waiting for all</a> elements of <var>result</var>. 
       </ol>
      </div>
      <div class="algorithm" data-algorithm="Represented">
       <p> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="represented">Represented</dfn>(<var>obj</var>: Device or GATT Attribute) returns,
          depending on the type of <var>obj</var>: </p>
       <dl class="switch">
        <dt><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑧">BluetoothDevice</a></code>
        <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑤">[[representedDevice]]</a></code></code>
        <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice④">BluetoothRemoteGATTService</a></code>
        <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot">[[representedService]]</a></code></code>
        <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑤">BluetoothRemoteGATTCharacteristic</a></code>
        <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">[[representedCharacteristic]]</a></code></code>
        <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor④">BluetoothRemoteGATTDescriptor</a></code>
        <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot">[[representedDescriptor]]</a></code></code>
       </dl>
      </div>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.1.3" id="navigating-bluetooth-hierarchy"><span class="secno">5.1.3. </span><span class="content">Navigating the Bluetooth Hierarchy</span><a class="self-link" href="#navigating-bluetooth-hierarchy"></a></h4>
      <div class="algorithm" data-algorithm="GetGATTChildren">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="getgattchildren">GetGATTChildren</dfn>(<span class="argument-list"><var>attribute</var>: GATT Attribute,<br> <var>single</var>: boolean,<br> <var>uuidCanonicalizer</var>: function,<br> <var>uuid</var>: optional <code>(DOMString or unsigned int)</code>,<br> <var>allowedUuids</var>: optional <code>("all" or Array&lt;DOMString>)</code>,<br> <var>child type</var>: GATT declaration type),</span><br> the UA MUST perform the following steps: </p>
       <ol>
        <li> If <var>uuid</var> is present,
            set it to <var>uuidCanonicalizer</var>(<var>uuid</var>).
            If <var>uuidCanonicalizer</var> threw an exception,
            return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> that exception and abort these steps. 
        <li> If <var>uuid</var> is present and is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted③">blocklisted</a>,
            return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror④">SecurityError</a></code> and abort these steps. 
        <li>
          Let <var>deviceObj</var> be, depending on the type of <var>attribute</var>: 
         <dl class="switch">
          <dt><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑨">BluetoothDevice</a></code>
          <dd><code><var>attribute</var></code>
          <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑤">BluetoothRemoteGATTService</a></code>
          <dd><code><var>attribute</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device">device</a></code></code>
          <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑥">BluetoothRemoteGATTCharacteristic</a></code>
          <dd><code><var>attribute</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-service" id="ref-for-dom-bluetoothremotegattcharacteristic-service">service</a></code>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device①">device</a></code></code>
         </dl>
        <li> If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①">connected</a></code></code> is <code>false</code>,
            return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②">a promise rejected with</a> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror">NetworkError</a></code> and
            abort these steps. 
        <li>
          If <a data-link-type="dfn" href="#represented" id="ref-for-represented">Represented</a>(<var>attribute</var>) is <code>null</code>,
            return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with③">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code> and
            abort these steps. 
         <p class="note" role="note"><span>Note:</span> This happens when a Service or Characteristic is removed from the device
            or invalidated by a disconnection,
            and then its object is used again.</p>
        <li>
          <a data-link-type="dfn" href="#query-the-bluetooth-cache" id="ref-for-query-the-bluetooth-cache">Query the Bluetooth cache</a> in <code><var>deviceObj</var></code> for entries that: 
         <ul>
          <li>are within <a data-link-type="dfn" href="#represented" id="ref-for-represented①">Represented</a>(<var>attribute</var>),
          <li>have a type described by <var>child type</var>,
          <li>have a UUID that is not <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted④">blocklisted</a>,
          <li>if <var>uuid</var> is present, have a UUID of <var>uuid</var>,
          <li> if <var>allowedUuids</var> is present and not <code>"all"</code>,
                have a UUID in <var>allowedUuids</var>, and 
          <li>if the <var>single</var> flag is set, are the first of these.
         </ul>
          Let <var>promise</var> be the result. 
        <li>
          <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#upon-fulfillment" id="ref-for-upon-fulfillment">Upon fulfillment</a> of <var>promise</var> with <var>result</var>, run the
            following steps: 
         <ul>
          <li>If <var>result</var> is empty, throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror" id="ref-for-notfounderror②">NotFoundError</a></code>,
          <li> Otherwise, if the <var>single</var> flag is set,
                returns the first (only) element of <var>result</var>. 
          <li>Otherwise, return <var>result</var>.
         </ul>
       </ol>
      </div>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.1.4" id="identifying-attributes"><span class="secno">5.1.4. </span><span class="content">Identifying Services, Characteristics, and Descriptors</span><a class="self-link" href="#identifying-attributes"></a></h4>
      <p> When checking whether two Services, Characteristics, or Descriptors <var>a</var> and <var>b</var> are the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="same-attribute">same attribute</dfn>,
        the UA SHOULD determine that they are the same if <var>a</var> and <var>b</var> are inside the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑥">same device</a> and have the same <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle④">Attribute Handle</a>,
        but MAY use any algorithm it wants with the constraint that <var>a</var> and <var>b</var> MUST NOT be considered the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute①">same attribute</a> if
        they fit any of the following conditions: </p>
      <ul>
       <li>They are not both Services, both Characteristics, or both Descriptors.
       <li>They are both Services, but are not both primary or both secondary services.
       <li>They have different UUIDs.
       <li> Their parent Devices aren’t the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑦">same device</a> or
          their parent Services or Characteristics aren’t the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute②">same attribute</a>. 
      </ul>
      <p class="note" role="note"> This definition is loose because platform APIs expose their own notion of identity
        without documenting whether it’s based on <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle⑤">Attribute Handle</a> equality. </p>
      <p class="note" role="note"> For two Javascript objects <var>x</var> and <var>y</var> representing Services, Characteristics, or Descriptors, <code><var>x</var> === <var>y</var></code> returns
        whether the objects represent the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute③">same attribute</a>,
        because of how the <a data-link-type="dfn" href="#query-the-bluetooth-cache" id="ref-for-query-the-bluetooth-cache①">query the Bluetooth cache</a> algorithm
        creates and caches new objects. </p>
     </section>
    </section>
    <section data-link-for-hint="BluetoothRemoteGATTServer">
     <h3 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.2" data-lt="BluetoothRemoteGATTServer" id="bluetoothremotegattserver"><span class="secno">5.2. </span><span class="content">BluetoothRemoteGATTServer</span><span id="bluetoothgattremoteserver"></span></h3>
     <p> <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver④">BluetoothRemoteGATTServer</a></code> represents a <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server④">GATT Server</a> on a remote device. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑦"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑥"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑤"><c- g>BluetoothRemoteGATTServer</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject④"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⓪"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattserver-device" id="ref-for-dom-bluetoothremotegattserver-device①"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected②"><c- g>connected</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑥"><c- n>BluetoothRemoteGATTServer</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect①"><c- g>connect</c-></a>();
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect①"><c- g>disconnect</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑥"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservice" id="ref-for-dom-bluetoothremotegattserver-getprimaryservice①"><c- g>getPrimaryService</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid④"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTServer/getPrimaryService(service)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattserver-getprimaryservice-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattserver-getprimaryservice-service-service"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑦"><c- n>BluetoothRemoteGATTService</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservices" id="ref-for-dom-bluetoothremotegattserver-getprimaryservices"><c- g>getPrimaryServices</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑤"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTServer/getPrimaryServices(service), BluetoothRemoteGATTServer/getPrimaryServices()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattserver-getprimaryservices-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattserver-getprimaryservices-service-service"></a></dfn>);
};
</pre>
     <div class="note no-marker" role="note">
      <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑦">BluetoothRemoteGATTServer</a></code> attributes</div>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-device"><code>device</code></dfn> is the device running this server. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-connected"><code>connected</code></dfn> is true while this instance
        is connected to <code>this.device</code>.
        It can be false while the UA is physically connected,
        for example when there are other connected <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑧">BluetoothRemoteGATTServer</a></code> instances
        for other <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object③">global object</a>s. </p>
     </div>
     <p> When no ECMAScript code can
      observe an instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑨">BluetoothRemoteGATTServer</a></code> <var>server</var> anymore,
      the UA SHOULD run <code><var>server</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect②">disconnect()</a></code></code>. <span class="note"> Because <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③①">BluetoothDevice</a></code> instances are stored in <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot③">[[deviceInstanceMap]]</a></code></code>,
        this can’t happen at least until navigation releases the global object or
        closing the tab or window destroys the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context①">browsing context</a>. </span> <span class="note"> Disconnecting on garbage collection ensures that
        the UA doesn’t keep consuming resources on the remote device unnecessarily. </span> </p>
     <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①⓪">BluetoothRemoteGATTServer</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑤">internal slots</a> described in the following table: </p>
     <table class="data">
      <thead>
       <tr>
        <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑥">Internal Slot</a>
        <th>Initial Value
        <th>Description (non-normative)
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-activealgorithms-slot"><code>[[activeAlgorithms]]</code></dfn>
        <td><code>new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-set-objects" id="ref-for-sec-set-objects①">Set</a></code>()</code>
        <td> Contains a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects④">Promise</a></code> corresponding to each algorithm using this server’s connection. <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect③">disconnect()</a></code> empties this set so that
          the algorithm can tell whether its <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms③">realm</a> was ever disconnected while it was running. 
     </table>
     <div class="algorithm" data-algorithm="connect()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-connect"><code>connect()</code></dfn></code> method, when invoked,
        MUST perform the following steps: </p>
      <ol>
       <li>Let <var>promise</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise④">a new promise</a>.
       <li> If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑥">[[representedDevice]]</a></code></code> is <code>null</code>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑥">queue a task</a> to <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑤">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①">NetworkError</a></code>,
          return <var>promise</var>,
          and abort these steps. 
       <li>
         If the UA is currently using the Bluetooth system,
          it MAY <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑦">queue a task</a> to <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑥">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②">NetworkError</a></code>,
          return <var>promise</var>,
          and abort these steps. 
        <p class="issue" id="issue-f363405f"><a class="self-link" href="#issue-f363405f"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror③">NetworkError</a></code>,
          but for now sites need to serialize their use of this API
          and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
       <li> Add <var>promise</var> to <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot">[[activeAlgorithms]]</a></code></code>. 
       <li>
         Return <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>: 
        <ol>
         <li>
           If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑦">[[representedDevice]]</a></code></code> has no <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer③">ATT Bearer</a>,
              do the following sub-steps: 
          <ol>
           <li id="create-an-att-bearer">
            <a class="self-link" href="#create-an-att-bearer"></a> Attempt to create an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer④">ATT Bearer</a> using the procedures described
                  in "Connection Establishment" under <a data-link-type="dfn" href="#gap-interoperability-requirements" id="ref-for-gap-interoperability-requirements①">GAP Interoperability Requirements</a>.
                  Abort this attempt if <var>promise</var> is removed from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①">[[activeAlgorithms]]</a></code></code>. 
            <p class="note" role="note"><span>Note:</span> These procedures can wait forever
                  if a connectable advertisement isn’t received.
                  The website should call <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect④">disconnect()</a></code> if it no longer wants to connect.</p>
           <li> If this attempt was aborted because <var>promise</var> was removed from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot②">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑦">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror" id="ref-for-aborterror">AbortError</a></code> and abort these steps. 
           <li> If this attempt failed for another reason, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑧">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror④">NetworkError</a></code> and abort these steps. 
           <li> Use the <a data-link-type="dfn" href="#exchange-mtu" id="ref-for-exchange-mtu">Exchange MTU</a> procedure to negotiate the largest supported MTU.
                  Ignore any errors from this step. 
           <li>
             The UA MAY attempt to bond with the remote device using
                  the <a data-link-type="dfn" href="#br-edr-bonding-procedure" id="ref-for-br-edr-bonding-procedure">BR/EDR Bonding Procedure</a> or
                  the <a data-link-type="dfn" href="#le-bonding-procedure" id="ref-for-le-bonding-procedure">LE Bonding Procedure</a>. 
            <p class="note" role="note"><span>Note:</span> We would normally prefer to give the website control
                  over whether and when bonding happens,
                  but the <a href="https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html">Core Bluetooth</a> platform API doesn’t provide a way for UAs to implement such a knob.
                  Having a bond is more secure than not having one,
                  so this specification allows the UA to opportunistically create one
                  on platforms where that’s possible.
                  This may cause a user-visible pairing dialog to appear
                  when a connection is created,
                  instead of when a restricted characteristic is accessed.</p>
          </ol>
         <li>
           <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑧">Queue a task</a> to perform the following sub-steps: 
          <ol>
           <li> If <var>promise</var> is not in <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot③">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑨">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror" id="ref-for-aborterror①">AbortError</a></code>, <a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection">garbage-collect the connection</a> of <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑧">[[representedDevice]]</a></code></code>,
                  and abort these steps. 
           <li> Remove <var>promise</var> from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot④">[[activeAlgorithms]]</a></code></code>. 
           <li> If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑨">[[representedDevice]]</a></code></code> is <code>null</code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⓪">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror⑤">NetworkError</a></code>, <a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection①">garbage-collect the connection</a> of <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①⓪">[[representedDevice]]</a></code></code>,
                  and abort these steps. 
           <li> Set <code>this.connected</code> to <code>true</code>. 
           <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>this</code>. 
          </ol>
        </ol>
      </ol>
     </div>
     <div class="algorithm" data-algorithm="disconnect()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-disconnect"><code>disconnect()</code></dfn></code> method, when invoked,
        MUST perform the following steps: </p>
      <ol>
       <li> Clear <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑤">[[activeAlgorithms]]</a></code></code> to abort any <a href="#create-an-att-bearer">active <code>connect()</code> calls</a>. 
       <li> If <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected③">connected</a></code></code> is <code>false</code>, abort these steps. 
       <li> <a data-link-type="dfn" href="#clean-up-the-disconnected-device" id="ref-for-clean-up-the-disconnected-device">Clean up the disconnected device</a> <code>this.device</code>. 
       <li> Let <var>device</var> be <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①①">[[representedDevice]]</a></code></code>. 
       <li> <a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection②">Garbage-collect the connection</a> of <var>device</var>. 
      </ol>
     </div>
     <div class="algorithm" data-algorithm="garbage-collect the connection">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="garbage-collect-the-connection">garbage-collect the connection</dfn> of a <var>device</var>,
        the UA must, do the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>: </p>
      <ol>
       <li> If systems that aren’t using this API,
          either inside or outside of the UA,
          are using the <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑤">ATT Bearer</a>,
          abort this algorithm. 
       <li>
         For all <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③②">BluetoothDevice</a></code>s <code><var>deviceObj</var></code> in the whole UA: 
        <ol>
         <li> If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①②">[[representedDevice]]</a></code></code> is
              not the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑧">same device</a> as <var>device</var>,
              continue to the next <var>deviceObj</var>. 
         <li> If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected④">connected</a></code></code> is <code>true</code>,
              abort this algorithm. 
         <li> If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑥">[[activeAlgorithms]]</a></code></code> contains the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑤">Promise</a></code> of a call to <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect②">connect()</a></code>,
              abort this algorithm. 
        </ol>
       <li> Destroy <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑥">ATT Bearer</a>. 
      </ol>
     </div>
     <div class="algorithm" data-algorithm="connection-checking wrapper">
      <p class="note" role="note"> Algorithms need to fail if
        their <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①①">BluetoothRemoteGATTServer</a></code> was disconnected while they were running,
        even if the UA stays connected the whole time
        and the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①②">BluetoothRemoteGATTServer</a></code> is subsequently re-connected before they finish.
        We wrap the returned <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑥">Promise</a></code> to accomplish this. </p>
      <p> To create a <var>gattServer</var>-<dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="connection-checking-wrapper">connection-checking wrapper</dfn> around a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑦">Promise</a></code> <var>promise</var>, the UA MUST: </p>
      <ol>
       <li> If <code><var>gattServer</var>.connected</code> is <code>true</code>,
          add <var>promise</var> to <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑦">[[activeAlgorithms]]</a></code></code>. 
       <li>
         <a data-link-type="dfn">React</a> to <var>promise</var>: 
        <ul>
         <li>
          If <var>promise</var> was fulfilled with value <var>result</var>, then: 
          <ol>
           <li> If <var>promise</var> is in <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑧">[[activeAlgorithms]]</a></code></code>,
                  remove it and return <var>result</var>. 
           <li> Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror⑥">NetworkError</a></code>. <span class="note"> Because <var>gattServer</var> was disconnected
                    during the execution of the main algorithm. </span> 
          </ol>
         <li>
          If <var>promise</var> was rejected with reason <var>error</var>, then: 
          <ol>
           <li> If <var>promise</var> is in <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑨">[[activeAlgorithms]]</a></code></code>,
                  remove it and throw <var>error</var>. 
           <li> Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror⑦">NetworkError</a></code>. <span class="note"> Because <var>gattServer</var> was disconnected
                    during the execution of the main algorithm. </span> 
          </ol>
        </ul>
      </ol>
     </div>
     <div class="algorithm" data-algorithm="getPrimaryService(service)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-getprimaryservice"><code>getPrimaryService(<var>service</var>)</code></dfn></code> method, when invoked,
        MUST perform the following steps: </p>
      <ol>
       <li> If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot②">[[allowedServices]]</a></code></code> is not <code>"all"</code> and <var>service</var> is not in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot③">[[allowedServices]]</a></code></code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with④">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑤">SecurityError</a></code> and abort these steps. 
       <li> Return <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this.device</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑦">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot④">[[allowedServices]]</a></code></code>,<br> <i>child type</i>="GATT Primary Service")</span> 
      </ol>
     </div>
     <div class="algorithm" data-algorithm="getPrimaryServices(service)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export data-lt="getPrimaryServices(service)|getPrimaryServices()" id="dom-bluetoothremotegattserver-getprimaryservices"><code>getPrimaryServices(<var>service</var>)</code></dfn></code> method, when invoked,
        MUST perform the following steps: </p>
      <ol>
       <li> If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑤">[[allowedServices]]</a></code></code> is not <code>"all"</code>,
          and <var>service</var> is present
          and not in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑥">[[allowedServices]]</a></code></code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑤">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑥">SecurityError</a></code> and abort these steps. 
       <li> Return <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren①">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this.device</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑧">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑦">[[allowedServices]]</a></code></code>,<br> <i>child type</i>="GATT Primary Service")</span> 
      </ol>
     </div>
    </section>
    <section>
     <h3 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.3" data-lt="BluetoothRemoteGATTService" id="bluetoothremotegattservice"><span class="secno">5.3. </span><span class="content">BluetoothRemoteGATTService</span><span id="bluetoothgattservice"></span></h3>
     <p> <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑧">BluetoothRemoteGATTService</a></code> represents a GATT <a data-link-type="dfn" href="#service" id="ref-for-service⑦">Service</a>,
      a collection of characteristics and relationships to other services
      that encapsulate the behavior of part of a device. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑧"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑦"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑨"><c- g>BluetoothRemoteGATTService</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget②"><c- n>EventTarget</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑤"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③③"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device②"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid④"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattservice-uuid" id="ref-for-dom-bluetoothremotegattservice-uuid"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattservice-isprimary" id="ref-for-dom-bluetoothremotegattservice-isprimary①"><c- g>isPrimary</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑦"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic④"><c- g>getCharacteristic</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid"><c- n>BluetoothCharacteristicUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getCharacteristic(characteristic)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"><code><c- g>characteristic</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑧"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristics" id="ref-for-dom-bluetoothremotegattservice-getcharacteristics"><c- g>getCharacteristics</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid①"><c- n>BluetoothCharacteristicUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getCharacteristics(characteristic), BluetoothRemoteGATTService/getCharacteristics()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"><code><c- g>characteristic</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⓪"><c- n>BluetoothRemoteGATTService</c-></a>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservice" id="ref-for-dom-bluetoothremotegattservice-getincludedservice①"><c- g>getIncludedService</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑥"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getIncludedService(service)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getincludedservice-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getincludedservice-service-service"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①①"><c- n>BluetoothRemoteGATTService</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservices" id="ref-for-dom-bluetoothremotegattservice-getincludedservices"><c- g>getIncludedServices</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑦"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getIncludedServices(service), BluetoothRemoteGATTService/getIncludedServices()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getincludedservices-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getincludedservices-service-service"></a></dfn>);
};
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①②"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers②"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①③"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers②"><c- n>ServiceEventHandlers</c-></a>;
</pre>
     <div class="note no-marker" role="note">
      <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①④">BluetoothRemoteGATTService</a></code> attributes</div>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-device"><code>device</code></dfn> is the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③④">BluetoothDevice</a></code> representing
        the remote peripheral that the GATT service belongs to. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-uuid"><code>uuid</code></dfn> is the UUID of the service,
        e.g. <code>'0000180d-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml#" id="termref-for-⑧">Heart Rate</a> service. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-isprimary"><code>isPrimary</code></dfn> indicates whether the type of this service is primary or secondary. </p>
     </div>
     <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑤">BluetoothRemoteGATTService</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑦">internal slots</a> described in the following table: </p>
     <table class="data">
      <thead>
       <tr>
        <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑧">Internal Slot</a>
        <th>Initial Value
        <th>Description (non-normative)
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-representedservice-slot"><code>[[representedService]]</code></dfn>
        <td>&lt;always set in prose>
        <td> The <a data-link-type="dfn" href="#service" id="ref-for-service⑧">Service</a> this object represents,
          or <code>null</code> if the Service has been removed or otherwise invalidated. 
     </table>
     <div class="algorithm" data-algorithm="create a BluetoothRemoteGATTService representing">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-bluetoothremotegattservice-representing">create a <code>BluetoothRemoteGATTService</code> representing</dfn> a Service <var>service</var>,
        the UA must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑤">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>. </p>
      <ol>
       <li> Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑥">BluetoothRemoteGATTService</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot①">[[representedService]]</a></code> slot initialized to <var>service</var>. 
       <li> <a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing③">Get the <code>BluetoothDevice</code> representing</a> the device in which <var>service</var> appears,
          and let <var>device</var> be the result. 
       <li> If the previous step threw an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①①">reject</a> <var>promise</var> with that error and abort these steps. 
       <li> Initialize <code><var>result</var>.device</code> from <var>device</var>. 
       <li> Initialize <code><var>result</var>.uuid</code> from the UUID of <var>service</var>. 
       <li> If <var>service</var> is a Primary Service,
          initialize <code><var>result</var>.isPrimary</code> to true.
          Otherwise initialize <code><var>result</var>.isPrimary</code> to false. 
       <li><a data-link-type="dfn">Resolve</a> <var>promise</var> with <var>result</var>.
      </ol>
     </div>
     <div class="algorithm" data-algorithm="getCharacteristic(characteristic)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export id="dom-bluetoothremotegattservice-getcharacteristic"><code>getCharacteristic(<var>characteristic</var>)</code></dfn></code> method
        retrieves a <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic④">Characteristic</a> inside this Service.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren②">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic">BluetoothUUID.getCharacteristic</a></code>,<br> <i>uuid</i>=<code><var>characteristic</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Characteristic")</span> </blockquote>
     </div>
     <div class="algorithm" data-algorithm="getCharacteristics(characteristic)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getCharacteristics(characteristic)|getCharacteristics()" id="dom-bluetoothremotegattservice-getcharacteristics"><code>getCharacteristics(<var>characteristic</var>)</code></dfn></code> method
        retrieves a list of <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑤">Characteristic</a>s inside this Service.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren③">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic①">BluetoothUUID.getCharacteristic</a></code>,<br> <i>uuid</i>=<code><var>characteristic</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Characteristic")</span> </blockquote>
     </div>
     <div class="unstable algorithm" data-algorithm="getIncludedService(service)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export id="dom-bluetoothremotegattservice-getincludedservice"><code>getIncludedService(<var>service</var>)</code></dfn></code> method
        retrieves an <a data-link-type="dfn" href="#included-service" id="ref-for-included-service①">Included Service</a> inside this Service.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren④">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑨">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Included Service")</span> </blockquote>
     </div>
     <div class="unstable algorithm" data-algorithm="getIncludedServices(service)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getIncludedServices(service)|getIncludedServices()" id="dom-bluetoothremotegattservice-getincludedservices"><code>getIncludedServices(<var>service</var>)</code></dfn></code> method
        retrieves a list of <a data-link-type="dfn" href="#included-service" id="ref-for-included-service②">Included Service</a>s inside this Service.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑤">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⓪">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Included Service")</span> </blockquote>
     </div>
    </section>
    <section>
     <h3 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.4" data-lt="BluetoothRemoteGATTCharacteristic" id="bluetoothremotegattcharacteristic"><span class="secno">5.4. </span><span class="content">BluetoothRemoteGATTCharacteristic</span><span id="bluetoothgattcharacteristic"></span></h3>
     <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑨">BluetoothRemoteGATTCharacteristic</a></code> represents a GATT <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑥">Characteristic</a>, which is a basic data element that provides further information about a peripheral’s service.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑨"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑧"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⓪"><c- g>BluetoothRemoteGATTCharacteristic</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget③"><c- n>EventTarget</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑥"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑦"><c- n>BluetoothRemoteGATTService</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTService" href="#dom-bluetoothremotegattcharacteristic-service" id="ref-for-dom-bluetoothremotegattcharacteristic-service①"><c- g>service</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑤"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattcharacteristic-uuid" id="ref-for-dom-bluetoothremotegattcharacteristic-uuid"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties①"><c- n>BluetoothCharacteristicProperties</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothCharacteristicProperties" href="#dom-bluetoothremotegattcharacteristic-properties" id="ref-for-dom-bluetoothremotegattcharacteristic-properties"><c- g>properties</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑦"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value②"><c- g>value</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑤"><c- n>BluetoothRemoteGATTDescriptor</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptor" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor①"><c- g>getDescriptor</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid"><c- n>BluetoothDescriptorUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/getDescriptor(descriptor)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑥"><c- n>BluetoothRemoteGATTDescriptor</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptors" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptors"><c- g>getDescriptors</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid①"><c- n>BluetoothDescriptorUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/getDescriptors(descriptor), BluetoothRemoteGATTCharacteristic/getDescriptors()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑧"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue①"><c- g>readValue</c-></a>();
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevalue" id="ref-for-dom-bluetoothremotegattcharacteristic-writevalue①"><c- g>writeValue</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource④"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValue(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevalue-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevalue-value-value"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse"><c- g>writeValueWithResponse</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑤"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValueWithResponse(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"><c- g>writeValueWithoutResponse</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑥"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications①"><c- g>startNotifications</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①②"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-stopnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-stopnotifications"><c- g>stopNotifications</c-></a>();
};
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①③"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers③"><c- n>CharacteristicEventHandlers</c-></a>;
</pre>
     <div class="note no-marker" role="note">
      <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①④">BluetoothRemoteGATTCharacteristic</a></code> attributes</div>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-service"><code>service</code></dfn> is the GATT service this characteristic belongs to. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-uuid"><code>uuid</code></dfn> is the UUID of the characteristic,
        e.g. <code>'00002a37-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml#" id="termref-for-⑨"> Heart Rate Measurement</a> characteristic. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-properties"><code>properties</code></dfn> holds the properties of this characteristic. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-value"><code>value</code></dfn> is the currently cached characteristic value.
        This value gets updated when the value of the characteristic is read or updated via a notification or indication. </p>
     </div>
     <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑤">BluetoothRemoteGATTCharacteristic</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑨">internal slots</a> described in the following table: </p>
     <table class="data">
      <thead>
       <tr>
        <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①⓪">Internal Slot</a>
        <th>Initial Value
        <th>Description (non-normative)
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot"><code>[[representedCharacteristic]]</code></dfn>
        <td>&lt;always set in prose>
        <td> The <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑦">Characteristic</a> this object represents,
          or <code>null</code> if the Characteristic has been removed or otherwise invalidated. 
     </table>
     <div class="algorithm" data-algorithm="create a BluetoothRemoteGATTCharacteristic representing">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-bluetoothremotegattcharacteristic-representing">create a <code>BluetoothRemoteGATTCharacteristic</code> representing</dfn> a Characteristic <var>characteristic</var>,
        the UA must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑥">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⓪">in parallel</a>. </p>
      <ol>
       <li> Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑥">BluetoothRemoteGATTCharacteristic</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot①">[[representedCharacteristic]]</a></code> slot initialized to <var>characteristic</var>. 
       <li> Initialize <code><var>result</var>.service</code> from
          the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑧">BluetoothRemoteGATTService</a></code> instance representing
          the Service in which <var>characteristic</var> appears. 
       <li> Initialize <code><var>result</var>.uuid</code> from
          the UUID of <var>characteristic</var>. 
       <li> <a data-link-type="dfn" href="#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic" id="ref-for-create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">Create a <code>BluetoothCharacteristicProperties</code> instance
          from the Characteristic</a> <var>characteristic</var>,
          and let <var>propertiesPromise</var> be the result. 
       <li>Wait for <var>propertiesPromise</var> to settle.
       <li> If <var>propertiesPromise</var> was rejected, <a data-link-type="dfn">resolve</a> <var>promise</var> with <var>propertiesPromise</var> and
          abort these steps. 
       <li> Initialize <code><var>result</var>.properties</code> from
          the value <var>propertiesPromise</var> was fulfilled with. 
       <li> Initialize <code><var>result</var>.value</code> to <code>null</code>.
          The UA MAY initialize <code><var>result</var>.value</code> to
          a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑨">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor②">ArrayBuffer</a></code> containing
          the most recently read value from <var>characteristic</var> if this value is available. 
       <li><a data-link-type="dfn">Resolve</a> <var>promise</var> with <var>result</var>.
      </ol>
     </div>
     <div class="unstable algorithm" data-algorithm="getDescriptor(descriptor)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-getdescriptor"><code>getDescriptor(<var>descriptor</var>)</code></dfn></code> method
        retrieves a <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor③">Descriptor</a> inside this Characteristic.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑥">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor">BluetoothUUID.getDescriptor</a></code>,<br> <i>uuid</i>=<code><var>descriptor</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Descriptor")</span> </blockquote>
     </div>
     <div class="unstable algorithm" data-algorithm="getDescriptors(descriptor)">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="getDescriptors(descriptor)|getDescriptors()" id="dom-bluetoothremotegattcharacteristic-getdescriptors"><code>getDescriptors(<var>descriptor</var>)</code></dfn></code> method
        retrieves a list of <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor④">Descriptor</a>s inside this Characteristic.
        When invoked, it MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑦">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor①">BluetoothUUID.getDescriptor</a></code>,<br> <i>uuid</i>=<code><var>descriptor</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Descriptor")</span> </blockquote>
     </div>
     <div class="algorithm" data-algorithm="Characteristic.readValue()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-readvalue"><code>readValue()</code></dfn></code> method, when invoked,
        MUST run the following steps: </p>
      <ol>
       <li> If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads">blocklisted for reads</a>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑥">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑦">SecurityError</a></code> and abort these steps. 
       <li> If <code>this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑤">connected</a></code></code> is <code>false</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑦">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror⑧">NetworkError</a></code> and abort these steps. 
       <li> Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot②">[[representedCharacteristic]]</a></code></code>. 
       <li> If <var>characteristic</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑧">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror②">InvalidStateError</a></code> and
          abort these steps. 
       <li>
         Return a <code>this.service.device.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper①">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑦">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①①">in parallel</a>: 
        <ol>
         <li> If the <code>Read</code> bit is not set
              in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties">properties</a>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror①">NotSupportedError</a></code> and abort these steps. 
         <li>
           If the UA is currently using the Bluetooth system,
              it MAY <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror⑨">NetworkError</a></code> and abort these steps. 
          <p class="issue" id="issue-f363405f①"><a class="self-link" href="#issue-f363405f①"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⓪">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
         <li> Use any combination of the sub-procedures in
              the <a data-link-type="dfn" href="#characteristic-value-read" id="ref-for-characteristic-value-read">Characteristic Value Read</a> procedure
              to retrieve the value of <var>characteristic</var>.
              Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
         <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①④">reject</a> <var>promise</var> with that error and abort these steps. 
         <li>
           <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑨">Queue a task</a> to perform the following steps: 
          <ol>
           <li> If <var>promise</var> is not in <code>this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①⓪">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⑤">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①①">NetworkError</a></code> and abort these steps. 
           <li> Let <var>buffer</var> be an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor③">ArrayBuffer</a></code> holding the retrieved value,
                  and assign <code>new DataView(<var>buffer</var>)</code> to <code>this.value</code>. 
           <li> <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire②">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged①">characteristicvaluechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at <code>this</code>. 
           <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>this.value</code>. 
          </ol>
        </ol>
      </ol>
     </div>
     <div class="algorithm" data-algorithm="WriteCharacteristicValue">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="writecharacteristicvalue">WriteCharacteristicValue</dfn>(<span class="argument-list"><var>this</var>: BluetoothRemoteGATTCharacteristic,<br> <var>value</var>: BufferSource,<br> <var>response</var>: string),</span><br> the UA MUST perform the following steps: </p>
      <ol>
       <li> If <code><var>this</var>.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-writes" id="ref-for-blocklisted-for-writes">blocklisted for writes</a>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑨">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑧">SecurityError</a></code> and abort these steps. 
       <li> Let <var>bytes</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑥">a copy of the bytes held</a> by <code><var>value</var></code>. 
       <li> If <var>bytes</var> is more than 512 bytes long
          (the maximum length of an attribute value, per <a data-link-type="dfn" href="#long-attribute-values" id="ref-for-long-attribute-values">Long Attribute Values</a>)
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⓪">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror" id="ref-for-invalidmodificationerror">InvalidModificationError</a></code> and abort these steps. 
       <li> If <code><var>this</var>.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑥">connected</a></code></code> is <code>false</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①①">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①②">NetworkError</a></code> and abort these steps. 
       <li> Let <var>characteristic</var> be <code><var>this</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot③">[[representedCharacteristic]]</a></code></code>. 
       <li> If <var>characteristic</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①②">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror③">InvalidStateError</a></code> and
          abort these steps. 
       <li>
         Return a <code><var>this</var>.service.device.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper②">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑧">a new promise</a> <var>promise</var> and run the following steps in parallel. 
        <ol>
         <li> Assert: <var>response</var> is one of "required", "never", or "optional". 
         <li>
           <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⑥">Reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror②">NotSupportedError</a></code> and
              abort these steps if any of the following is true: 
          <ol>
           <li> <var>response</var> is "required" and <code>Write</code> bit is not set in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties①">properties</a> 
           <li> <var>response</var> is "never" and none of <code>Write Without Response</code> or <code>Authenticated Signed Writes</code> bits are set
                 in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties②">properties</a> 
           <li> <var>response</var> is "optional" and none of the <code>Write</code>, <code>Write Without Response</code> or <code>Authenticated Signed Writes</code> bits are set
                 in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties③">properties</a> 
          </ol>
         <li>
           If the UA is currently using the Bluetooth system,
              it MAY <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⑦">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①③">NetworkError</a></code> and abort these steps. 
          <p class="issue" id="issue-f363405f②"><a class="self-link" href="#issue-f363405f②"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①④">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
         <li>
           Write <var>bytes</var> to <var>characteristic</var> by performing
              the following steps: 
          <dl class="switch">
           <dt>If <var>response</var> is "required"
           <dd> Use the <a data-link-type="dfn" href="#write-characteristic-value" id="ref-for-write-characteristic-value">Write Characteristic Value</a> procedure. 
           <dt>If <var>response</var> is "never"
           <dd> Use the <a data-link-type="dfn" href="#write-without-response" id="ref-for-write-without-response">Write Without Response</a> procedure. 
           <dt>Otherwise
           <dd> Use any combination of the sub-procedures in
                  the <a data-link-type="dfn" href="#characteristic-value-write" id="ref-for-characteristic-value-write">Characteristic Value Write</a> procedure. 
          </dl>
           Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
         <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⑧">reject</a> <var>promise</var> with that error and abort these steps. 
         <li>
           <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⓪">Queue a task</a> to perform the following steps: 
          <ol>
           <li> If <var>promise</var> is not in <code><var>this</var>.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①①">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①⑨">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⑤">NetworkError</a></code> and abort these steps. 
           <li> Set <code><var>this</var>.value</code> to
                  a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⓪">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor④">ArrayBuffer</a></code> containing <var>bytes</var>. 
           <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>undefined</code>. 
          </ol>
        </ol>
      </ol>
     </div>
     <div class="algorithm" data-algorithm="Characteristic.writeValue()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-writevalue"><code>writeValue(<var>value</var>)</code></dfn></code> method, 
        when invoked, MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue">WriteCharacteristicValue</a>(<span class="argument-list"><i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="optional")</span> </blockquote>
     </div>
     <div class="unstable algorithm" data-algorithm="Characteristic.writeValueWithResponse()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithresponse"><code>writeValueWithResponse(<var>value</var>)</code></dfn></code> method, 
        when invoked, MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue①">WriteCharacteristicValue</a>(<span class="argument-list"><i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="required")</span> </blockquote>
     </div>
     <div class="unstable algorithm" data-algorithm="Characteristic.writeValueWithoutResponse()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"><code>writeValueWithoutResponse(<var>value</var>)</code></dfn></code> method, 
        when invoked, MUST return </p>
      <blockquote> <a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue②">WriteCharacteristicValue</a>(<span class="argument-list"><i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="never")</span> </blockquote>
     </div>
     <p> The UA MUST maintain a map from each known GATT <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑧">Characteristic</a> to
      a set of <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑨">Bluetooth</a></code> objects known as
      the characteristic’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="active-notification-context-set">active notification context set</dfn>. <span class="note"> The set for a given characteristic holds
        the <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth">navigator.bluetooth</a></code> objects for
        each <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms④">Realm</a> that has registered for notifications.
        All notifications become inactive when a device is disconnected.
        A site that wants to keep getting notifications after reconnecting
        needs to call <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications②">startNotifications()</a></code> again,
        and there is an unavoidable risk that
        some notifications will be missed
        in the gap before <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications③">startNotifications()</a></code> takes effect. </span> </p>
     <div class="algorithm" data-algorithm="startNotifications()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-startnotifications"><code>startNotifications()</code></dfn></code> method, when invoked,
        MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑨">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①②">in parallel</a>.
        See <a href="#notification-events">§ 5.6.4 Responding to Notifications and Indications</a> for details of receiving notifications. </p>
      <ol>
       <li> If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads①">blocklisted for reads</a>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⓪">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑨">SecurityError</a></code> and abort these steps. 
       <li> If <code>this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑦">connected</a></code></code> is <code>false</code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②①">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⑥">NetworkError</a></code> and abort these steps. 
       <li> Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot④">[[representedCharacteristic]]</a></code></code>. 
       <li> If <var>characteristic</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①③">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror④">InvalidStateError</a></code> and
          abort these steps. 
       <li> If neither of the <code>Notify</code> or <code>Indicate</code> bits are set
          in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties④">properties</a>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror③">NotSupportedError</a></code> and abort these steps. 
       <li> If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set">active notification context set</a> contains <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth①">navigator.bluetooth</a></code>, <a data-link-type="dfn">resolve</a> <var>promise</var> with <code>this</code> and abort these steps. 
       <li>
         If the UA is currently using the Bluetooth system,
          it MAY <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⑦">NetworkError</a></code> and abort these steps. 
        <p class="issue" id="issue-f363405f③"><a class="self-link" href="#issue-f363405f③"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⑧">NetworkError</a></code>,
          but for now sites need to serialize their use of this API
          and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
       <li>
         If the characteristic has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration">Client Characteristic Configuration</a> descriptor, use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors">Characteristic Descriptors</a> procedures
          to ensure that one of the <code>Notification</code> or <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration①">Client Characteristic Configuration</a> descriptor
          is set, matching the constraints
          in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties⑤">properties</a>.
          The UA SHOULD avoid setting both bits,
          and MUST deduplicate <a href="#notification-events">value-change events</a> if both bits are set.
          Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
        <p class="note" role="note"><span>Note:</span> Some devices have characteristics whose properties include the
          Notify or Indicate bit but that don’t have a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration②">Client Characteristic
          Configuration</a> descriptor. These non-standard-compliant characteristics
          tend to send notifications or indications unconditionally, so this
          specification allows applications to simply subscribe to their
          messages.</p>
       <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②④">reject</a> <var>promise</var> with that error and abort these steps. 
       <li> Add <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth②">navigator.bluetooth</a></code> to <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set①">active notification context set</a>. 
       <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>this</code>. 
      </ol>
      <p class="note" role="note"> After notifications are enabled,
        the resulting <a href="#notification-events">value-change events</a> won’t be delivered
        until after the current <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint" id="ref-for-perform-a-microtask-checkpoint">microtask checkpoint</a>.
        This allows a developer to set up handlers
        in the <code>.then</code> handler of the result promise. </p>
     </div>
     <div class="algorithm" data-algorithm="stopNotifications()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-stopnotifications"><code>stopNotifications()</code></dfn></code> method, when invoked,
        MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①⓪">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①③">in parallel</a>: </p>
      <ol>
       <li> Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑤">[[representedCharacteristic]]</a></code></code>. 
       <li> If <var>characteristic</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①④">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑤">InvalidStateError</a></code> and
          abort these steps. 
       <li> If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set②">active notification context set</a> contains <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth③">navigator.bluetooth</a></code>,
          remove it. 
       <li> If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set③">active notification context set</a> became empty
          and the characteristic has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration③">Client Characteristic Configuration</a> descriptor,
          the UA SHOULD use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors①">Characteristic Descriptors</a> procedures
          to clear the <code>Notification</code> and <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration④">Client Characteristic Configuration</a> descriptor. 
       <li> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①①">Queue a task</a> to <a data-link-type="dfn">resolve</a> <var>promise</var> with <code>this</code>. 
      </ol>
      <p class="note" role="note"> Queuing a task to resolve the promise ensures that
        no <a href="#notification-events">value change events</a> due to notifications
        arrive after the promise resolves. </p>
     </div>
     <section>
      <h4 class="heading settled" data-level="5.4.1" id="characteristicproperties"><span class="secno">5.4.1. </span><span class="content"><dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothcharacteristicproperties"><code>BluetoothCharacteristicProperties</code></dfn></span><a class="self-link" href="#characteristicproperties"></a></h4>
      <p> Each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑦">BluetoothRemoteGATTCharacteristic</a></code> exposes its <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties⑥">characteristic properties</a> through a <code class="idl"><a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties②">BluetoothCharacteristicProperties</a></code> object.
        These properties express what operations are valid on the characteristic. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①⓪"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑨"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties③"><c- g>BluetoothCharacteristicProperties</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-broadcast"><code><c- g>broadcast</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-broadcast"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-read"><code><c- g>read</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-read"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑨"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-writewithoutresponse"><code><c- g>writeWithoutResponse</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-writewithoutresponse"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⓪"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-write"><code><c- g>write</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-write"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-notify"><code><c- g>notify</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-notify"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①②"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-indicate"><code><c- g>indicate</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-indicate"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①③"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"><code><c- g>authenticatedSignedWrites</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①④"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-reliablewrite"><code><c- g>reliableWrite</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-reliablewrite"></a></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⑤"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-writableauxiliaries"><code><c- g>writableAuxiliaries</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-writableauxiliaries"></a></dfn>;
};
</pre>
      <div class="algorithm" data-algorithm="create a BluetoothCharacteristicProperties instance from the Characteristic">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="create a BluetoothCharacteristicProperties instance from the Characteristic" data-noexport id="create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">create a <code>BluetoothCharacteristicProperties</code> instance
          from the Characteristic</dfn> <var>characteristic</var>,
          the UA MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①①">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①④">in parallel</a>: </p>
       <ol>
        <li> Let <var>propertiesObj</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties④">BluetoothCharacteristicProperties</a></code>. 
        <li> Let <var>properties</var> be
            the <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties⑦">characteristic properties</a> of <var>characteristic</var>. 
        <li>
          Initialize the attributes of <var>propertiesObj</var> from
            the corresponding bits in <var>properties</var>: 
         <table class="data">
          <thead>
           <tr>
            <th>Attribute
            <th>Bit
          <tbody>
           <tr>
            <td><code>broadcast</code>
            <td>Broadcast
           <tr>
            <td><code>read</code>
            <td>Read
           <tr>
            <td><code>writeWithoutResponse</code>
            <td>Write Without Response
           <tr>
            <td><code>write</code>
            <td>Write
           <tr>
            <td><code>notify</code>
            <td>Notify
           <tr>
            <td><code>indicate</code>
            <td>Indicate
           <tr>
            <td><code>authenticatedSignedWrites</code>
            <td>Authenticated Signed Writes
         </table>
        <li>
          If the Extended Properties bit of the <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties⑧">characteristic properties</a> is not set,
            initialize <code><var>propertiesObj</var>.reliableWrite</code> and <code><var>propertiesObj</var>.writableAuxiliaries</code> to <code>false</code>.
            Otherwise, run the following steps: 
         <ol>
          <li>
            <a data-link-type="dfn" href="#characteristic-descriptor-discovery" id="ref-for-characteristic-descriptor-discovery">Discover</a> the <a data-link-type="dfn" href="#characteristic-extended-properties" id="ref-for-characteristic-extended-properties">Characteristic Extended Properties</a> descriptor for <var>characteristic</var> and <a data-link-type="dfn" href="#read-characteristic-descriptors" id="ref-for-read-characteristic-descriptors">read its value</a> into <var>extendedProperties</var>.
                Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
           <p class="issue" id="issue-997f7afd"><a class="self-link" href="#issue-997f7afd"></a> <a data-link-type="dfn" href="#characteristic-extended-properties" id="ref-for-characteristic-extended-properties①">Characteristic Extended Properties</a> isn’t clear whether
                  the extended properties are immutable for a given Characteristic.
                  If they are, the UA should be allowed to cache them. </p>
          <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⑤">reject</a> <var>promise</var> with that error and abort these steps. 
          <li> Initialize <code><var>propertiesObj</var>.reliableWrite</code> from
                the Reliable Write bit of <var>extendedProperties</var>. 
          <li> Initialize <code><var>propertiesObj</var>.writableAuxiliaries</code> from
                the Writable Auxiliaries bit of <var>extendedProperties</var>. 
         </ol>
        <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <var>propertiesObj</var>. 
       </ol>
      </div>
     </section>
    </section>
    <section class="unstable">
     <h3 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.5" data-lt="BluetoothRemoteGATTDescriptor" id="bluetoothremotegattdescriptor"><span class="secno">5.5. </span><span class="content">BluetoothRemoteGATTDescriptor</span><span id="bluetoothgattdescriptor"></span></h3>
     <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑦">BluetoothRemoteGATTDescriptor</a></code> represents a GATT <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑤">Descriptor</a>, which provides further information about a <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑨">Characteristic</a>’s value.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①⓪"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑧"><c- g>BluetoothRemoteGATTDescriptor</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑦"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑧"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTCharacteristic" href="#dom-bluetoothremotegattdescriptor-characteristic" id="ref-for-dom-bluetoothremotegattdescriptor-characteristic"><c- g>characteristic</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑥"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattdescriptor-uuid" id="ref-for-dom-bluetoothremotegattdescriptor-uuid"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①①"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattdescriptor-value" id="ref-for-dom-bluetoothremotegattdescriptor-value"><c- g>value</c-></a>;
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①②"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-readvalue" id="ref-for-dom-bluetoothremotegattdescriptor-readvalue"><c- g>readValue</c-></a>();
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-writevalue" id="ref-for-dom-bluetoothremotegattdescriptor-writevalue"><c- g>writeValue</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑦"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor/writeValue(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattdescriptor-writevalue-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattdescriptor-writevalue-value-value"></a></dfn>);
};
</pre>
     <div class="note no-marker" role="note">
      <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑨">BluetoothRemoteGATTDescriptor</a></code> attributes</div>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-characteristic"><code>characteristic</code></dfn> is the GATT characteristic this descriptor belongs to. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-uuid"><code>uuid</code></dfn> is the UUID of the characteristic descriptor,
        e.g. <code>'00002902-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml#" id="termref-for-①⓪"> Client Characteristic Configuration</a> descriptor. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-value"><code>value</code></dfn> is the currently cached descriptor value.
        This value gets updated when the value of the descriptor is read. </p>
     </div>
     <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①⓪">BluetoothRemoteGATTDescriptor</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①①">internal slots</a> described in the following table: </p>
     <table class="data">
      <thead>
       <tr>
        <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①②">Internal Slot</a>
        <th>Initial Value
        <th>Description (non-normative)
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-representeddescriptor-slot"><code>[[representedDescriptor]]</code></dfn>
        <td>&lt;always set in prose>
        <td> The <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑥">Descriptor</a> this object represents,
          or <code>null</code> if the Descriptor has been removed or otherwise invalidated. 
     </table>
     <div class="algorithm" data-algorithm="create a BluetoothRemoteGATTDescriptor representing">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-bluetoothremotegattdescriptor-representing">create a <code>BluetoothRemoteGATTDescriptor</code> representing</dfn> a Descriptor <var>descriptor</var>,
        the UA must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①②">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑤">in parallel</a>. </p>
      <ol>
       <li> Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①①">BluetoothRemoteGATTDescriptor</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot①">[[representedDescriptor]]</a></code> slot initialized to <var>descriptor</var>. 
       <li> Initialize <code><var>result</var>.characteristic</code> from
          the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑨">BluetoothRemoteGATTCharacteristic</a></code> instance representing
          the Characteristic in which <var>descriptor</var> appears. 
       <li> Initialize <code><var>result</var>.uuid</code> from the UUID of <var>descriptor</var>. 
       <li> Initialize <code><var>result</var>.value</code> to <code>null</code>.
          The UA MAY initialize <code><var>result</var>.value</code> to
          a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①③">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑤">ArrayBuffer</a></code> containing
          the most recently read value from <var>descriptor</var> if this value is available. 
       <li><a data-link-type="dfn">Resolve</a> <var>promise</var> with <var>result</var>.
      </ol>
     </div>
     <div class="algorithm" data-algorithm="Descriptor.readValue()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="method" data-export id="dom-bluetoothremotegattdescriptor-readvalue"><code>readValue()</code></dfn></code> method, when invoked,
        MUST run the following steps: </p>
      <ol>
       <li> If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads②">blocklisted for reads</a>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑤">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①⓪">SecurityError</a></code> and abort these steps. 
       <li> If <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑧">connected</a></code></code> is <code>false</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑥">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror①⑨">NetworkError</a></code> and abort these steps. 
       <li> Let <var>descriptor</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot②">[[representedDescriptor]]</a></code></code>. 
       <li> If <var>descriptor</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑦">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑥">InvalidStateError</a></code> and
          abort these steps. 
       <li>
         Return a <code>this.characteristic.service.device.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper③">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①③">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑥">in parallel</a>: 
        <ol>
         <li>
           If the UA is currently using the Bluetooth system,
              it MAY <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⑥">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②⓪">NetworkError</a></code> and abort these steps. 
          <p class="issue" id="issue-f363405f④"><a class="self-link" href="#issue-f363405f④"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②①">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
         <li> Use either the <a data-link-type="dfn" href="#read-characteristic-descriptors" id="ref-for-read-characteristic-descriptors①">Read Characteristic Descriptors</a> or
              the <a data-link-type="dfn" href="#read-long-characteristic-descriptors" id="ref-for-read-long-characteristic-descriptors">Read Long Characteristic Descriptors</a> sub-procedure
              to retrieve the value of <var>descriptor</var>.
              Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
         <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⑦">reject</a> <var>promise</var> with that error and abort these steps. 
         <li>
           <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①②">Queue a task</a> to perform the following steps: 
          <ol>
           <li> If <var>promise</var> is not in <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①②">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⑧">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②②">NetworkError</a></code> and abort these steps. 
           <li> Let <var>buffer</var> be an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑥">ArrayBuffer</a></code> holding the retrieved value,
                  and assign <code>new DataView(<var>buffer</var>)</code> to <code>this.value</code>. 
           <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>this.value</code>. 
          </ol>
        </ol>
      </ol>
     </div>
     <div class="algorithm" data-algorithm="Descriptor.writeValue()">
      <p> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="method" data-export id="dom-bluetoothremotegattdescriptor-writevalue"><code>writeValue(<var>value</var>)</code></dfn></code> method, when invoked,
        MUST  run the following steps: </p>
      <ol>
       <li> If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-writes" id="ref-for-blocklisted-for-writes①">blocklisted for writes</a>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑧">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①①">SecurityError</a></code> and abort these steps. 
       <li> Let <var>bytes</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑦">a copy of the bytes held</a> by <code><var>value</var></code>. 
       <li> If <var>bytes</var> is more than 512 bytes long
          (the maximum length of an attribute value, per <a data-link-type="dfn" href="#long-attribute-values" id="ref-for-long-attribute-values①">Long Attribute Values</a>)
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑨">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror" id="ref-for-invalidmodificationerror①">InvalidModificationError</a></code> and abort these steps. 
       <li> If <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑨">connected</a></code></code> is <code>false</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②⓪">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②③">NetworkError</a></code> and abort these steps. 
       <li> Let <var>descriptor</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot③">[[representedDescriptor]]</a></code></code>. 
       <li> If <var>descriptor</var> is <code>null</code>,
          return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②①">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑦">InvalidStateError</a></code> and
          abort these steps. 
       <li>
         Return a <code>this.characteristic.service.device.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper④">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①④">a new promise</a> <var>promise</var> and run the following steps in parallel. 
        <ol>
         <li>
           If the UA is currently using the Bluetooth system,
              it MAY <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②⑨">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②④">NetworkError</a></code> and abort these steps. 
          <p class="issue" id="issue-f363405f⑤"><a class="self-link" href="#issue-f363405f⑤"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②⑤">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a></p>
         <li> Use either the <a data-link-type="dfn" href="#write-characteristic-descriptors" id="ref-for-write-characteristic-descriptors">Write Characteristic Descriptors</a> or
              the <a data-link-type="dfn" href="#write-long-characteristic-descriptors" id="ref-for-write-long-characteristic-descriptors">Write Long Characteristic Descriptors</a> sub-procedure
              to write <var>bytes</var> to <var>descriptor</var>.
              Handle errors as described in <a href="#error-handling">§ 5.7 Error handling</a>. 
         <li> If the previous step returned an error, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise③⓪">reject</a> <var>promise</var> with that error and abort these steps. 
         <li>
           <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①③">Queue a task</a> to perform the following steps: 
          <ol>
           <li> If <var>promise</var> is not in <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①③">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise③①">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②⑥">NetworkError</a></code> and abort these steps. 
           <li> Set <code>this.value</code> to
                  a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①④">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑦">ArrayBuffer</a></code> containing <var>bytes</var>. 
           <li> <a data-link-type="dfn">Resolve</a> <var>promise</var> with <code>undefined</code>. 
          </ol>
        </ol>
      </ol>
     </div>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.6" id="events"><span class="secno">5.6. </span><span class="content">Events</span><a class="self-link" href="#events"></a></h3>
     <section class="unstable">
      <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="5.6.1" data-lt="Bluetooth Tree" data-noexport id="bluetooth-tree"><span class="secno">5.6.1. </span><span class="content">Bluetooth Tree</span></h4>
      <p> <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth④">navigator.bluetooth</a></code> and
        objects implementing the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑤">BluetoothDevice</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑨">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②⓪">BluetoothRemoteGATTCharacteristic</a></code>, or <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①②">BluetoothRemoteGATTDescriptor</a></code> interface <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-participate" id="ref-for-concept-tree-participate">participate in a tree</a>,
        simply named the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree">Bluetooth tree</a>. </p>
      <ul>
       <li> The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child">children</a> of <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑤">navigator.bluetooth</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑥">BluetoothDevice</a></code> objects representing
          devices in the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissiondata-alloweddevices" id="ref-for-dom-bluetoothpermissiondata-alloweddevices⑤">allowedDevices</a></code> list
          in <code class="idl"><a data-link-type="idl" href="#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth⑦">"bluetooth"</a></code>'s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#extra-permission-data" id="ref-for-extra-permission-data⑥">extra permission data</a> for <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑥">navigator.bluetooth</a></code>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object②">relevant settings object</a>,
          in an unspecified order. 
       <li> The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child①">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑦">BluetoothDevice</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⓪">BluetoothRemoteGATTService</a></code> objects representing
          Primary and Secondary <a data-link-type="dfn" href="#service" id="ref-for-service⑨">Service</a>s on its <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server⑤">GATT Server</a> whose UUIDs are on the origin and device’s <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices⑤">allowedServices</a></code> list.
          The order of the primary services MUST be consistent with the order returned by
          the <a data-link-type="dfn" href="#discover-primary-service-by-service-uuid" id="ref-for-discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</a> procedure,
          but secondary services and primary services with different UUIDs may be in any order. 
       <li> The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child②">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②①">BluetoothRemoteGATTService</a></code> are
          the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②①">BluetoothRemoteGATTCharacteristic</a></code> objects representing its Characteristics.
          The order of the characteristics MUST be consistent with the order returned by
          the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid②">Discover Characteristics by UUID</a> procedure,
          but characteristics with different UUIDs may be in any order. 
       <li> The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child③">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②②">BluetoothRemoteGATTCharacteristic</a></code> are
          the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①③">BluetoothRemoteGATTDescriptor</a></code> objects representing its Descriptors
          in the order returned by the <a data-link-type="dfn" href="#discover-all-characteristic-descriptors" id="ref-for-discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</a> procedure. 
      </ul>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.6.2" id="event-types"><span class="secno">5.6.2. </span><span class="content">Event types</span><a class="self-link" href="#event-types"></a></h4>
      <dl>
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="event" data-export id="eventdef-bluetoothdevice-advertisementreceived"><code>advertisementreceived</code></dfn>
       <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑧">BluetoothDevice</a></code> when an <a href="#advertising-event-algorithm">advertising event
          is received from that device</a>. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="event" data-export id="eventdef-bluetooth-availabilitychanged"><code>availabilitychanged</code></dfn>
       <dd> Fired on <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth①⓪">navigator.bluetooth</a></code> when <a href="#availability-changed-algorithm">the Bluetooth system as a whole
          becomes available or unavailable to the UA</a>. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="event" data-export id="eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged"><code>characteristicvaluechanged</code></dfn>
       <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②③">BluetoothRemoteGATTCharacteristic</a></code> when its value changes,
          either as a result of
          a <a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue②">read request</a>,
          or a <a href="#notification-events">value change notification/indication</a>. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="event" data-export id="eventdef-bluetoothdevice-gattserverdisconnected"><code>gattserverdisconnected</code></dfn>
       <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑨">BluetoothDevice</a></code> when <a href="#disconnection-events">an active GATT connection is lost</a>. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export id="eventdef-bluetoothremotegattservice-serviceadded"><code>serviceadded</code></dfn>
       <dd> Fired on a new <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②②">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when it has been discovered on a remote device</a>,
          just after it is added to the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree①">Bluetooth tree</a>. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export id="eventdef-bluetoothremotegattservice-servicechanged"><code>servicechanged</code></dfn>
       <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②③">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when its state changes</a>.
          This involves any characteristics and/or descriptors
          that get added or removed from the service,
          as well as <a data-link-type="dfn" href="#service-changed" id="ref-for-service-changed">Service Changed</a> indications from the remote device. 
       <dt><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export id="eventdef-bluetoothremotegattservice-serviceremoved"><code>serviceremoved</code></dfn>
       <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②④">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when it has been removed from its device</a>,
          just before it is removed from the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree②">Bluetooth tree</a>. 
      </dl>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.6.3" id="disconnection-events"><span class="secno">5.6.3. </span><span class="content">Responding to Disconnection</span><a class="self-link" href="#disconnection-events"></a></h4>
      <div class="algorithm" data-algorithm="disconnection">
       <p> When a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑤">Bluetooth device</a> <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑦">ATT Bearer</a> is lost
          (e.g. because the remote device moved out of range
          or the user used a platform feature to disconnect it),
          for each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⓪">BluetoothDevice</a></code> <var>deviceObj</var> the UA MUST <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①④">queue a task</a> on <var>deviceObj</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object③">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop②">responsible event loop</a> to perform the following steps: </p>
       <ol>
        <li> If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①③">[[representedDevice]]</a></code></code> is not the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑨">same device</a> as <var>device</var>,
            abort these steps. 
        <li> If <code>!<var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①⓪">connected</a></code></code>,
            abort these steps. 
        <li> <a data-link-type="dfn" href="#clean-up-the-disconnected-device" id="ref-for-clean-up-the-disconnected-device①">Clean up the disconnected device</a> <var>deviceObj</var>. 
       </ol>
      </div>
      <div class="algorithm" data-algorithm="clean up the disconnected device">
       <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="clean-up-the-disconnected-device">clean up the disconnected device</dfn> <var>deviceObj</var>, the UA must: </p>
       <ol>
        <li> Set <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①①">connected</a></code></code> to <code>false</code>. 
        <li> Clear <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①④">[[activeAlgorithms]]</a></code></code>. 
        <li> Let <var>context</var> be <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot②">[[context]]</a></code></code>. 
        <li> Remove all entries from <code><var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot③">[[attributeInstanceMap]]</a></code></code> whose keys are inside <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①④">[[representedDevice]]</a></code></code>. 
        <li> For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑤">BluetoothRemoteGATTService</a></code> <var>service</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑤">realm</a>,
            set <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot②">[[representedService]]</a></code></code> to <code>null</code>. 
        <li>
          For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②④">BluetoothRemoteGATTCharacteristic</a></code> <var>characteristic</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑥">realm</a>, do the following sub-steps: 
         <ol>
          <li> Let <var>notificationContexts</var> be <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑥">[[representedCharacteristic]]</a></code></code>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set④">active notification context set</a>. 
          <li> Remove <var>context</var> from <var>notificationContexts</var>. 
          <li> If <var>notificationContexts</var> became empty
                and there is still an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑧">ATT Bearer</a> to <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①⑤">[[representedDevice]]</a></code></code> and <var>characteristic</var> has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration⑤">Client Characteristic
                Configuration</a> descriptor,
                the UA SHOULD use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors②">Characteristic Descriptors</a> procedures
                to clear the <code>Notification</code> and <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration⑥">Client Characteristic Configuration</a> descriptor. 
          <li> Set <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑦">[[representedCharacteristic]]</a></code></code> to <code>null</code>. 
         </ol>
        <li> For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①④">BluetoothRemoteGATTDescriptor</a></code> <var>descriptor</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑦">realm</a>,
            set <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot④">[[representedDescriptor]]</a></code></code> to <code>null</code>. 
        <li>
          <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire③">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-gattserverdisconnected" id="ref-for-eventdef-bluetoothdevice-gattserverdisconnected①">gattserverdisconnected</a></code> with its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-bubbles" id="ref-for-dom-event-bubbles">bubbles</a></code> attribute initialized to <code>true</code> at <code><var>deviceObj</var></code>. 
         <p class="note" role="note"> This event is <em>not</em> fired at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①③">BluetoothRemoteGATTServer</a></code>. </p>
       </ol>
      </div>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.6.4" id="notification-events"><span class="secno">5.6.4. </span><span class="content">Responding to Notifications and Indications</span><a class="self-link" href="#notification-events"></a></h4>
      <div class="algorithm" data-algorithm="notifications">
       <p> When the UA receives a Bluetooth <a data-link-type="dfn" href="#characteristic-value-notification" id="ref-for-characteristic-value-notification">Characteristic Value Notification</a> or <a data-link-type="dfn" href="#characteristic-value-indications" id="ref-for-characteristic-value-indications">Indication</a>,
          it must perform the following steps: </p>
       <ol>
        <li>
          For each <var>bluetoothGlobal</var> in
            the Characteristic’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set⑤">active notification context set</a>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑤">queue a task</a> on the event loop of the script settings object of <var>bluetoothGlobal</var> to do the following sub-steps: 
         <ol>
          <li> Let <var>characteristicObject</var> be the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②⑤">BluetoothRemoteGATTCharacteristic</a></code> in
                the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree③">Bluetooth tree</a> rooted at <var>bluetoothGlobal</var> that represents the <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①⓪">Characteristic</a>. 
          <li> If <code><var>characteristicObject</var>.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①②">connected</a></code></code> is <code>false</code>,
                abort these sub-steps. 
          <li> Set <code><var>characteristicObject</var>.value</code> to
                a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⑤">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑧">ArrayBuffer</a></code> holding
                the new value of the <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①①">Characteristic</a>. 
          <li> <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire④">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged②">characteristicvaluechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at <var>characteristicObject</var>. 
         </ol>
       </ol>
      </div>
     </section>
     <section class="unstable">
      <h4 class="heading settled" data-level="5.6.5" id="service-change-events"><span class="secno">5.6.5. </span><span class="content">Responding to Service Changes</span><a class="self-link" href="#service-change-events"></a></h4>
      <div class="algorithm" data-algorithm="service changes">
       <p> The Bluetooth <a data-link-type="dfn" href="#attribute-caching" id="ref-for-attribute-caching①">Attribute Caching</a> system allows clients
          to track changes to <a data-link-type="dfn" href="#service" id="ref-for-service①⓪">Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①②">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑦">Descriptor</a>s.
          Before discovering any of these attributes for the purpose of exposing them to a web page
          the UA MUST subscribe to Indications from the <a data-link-type="dfn" href="#service-changed" id="ref-for-service-changed①">Service Changed</a> characteristic, if it exists.
          When the UA receives an Indication on the Service Changed characteristic,
          it MUST perform the following steps. </p>
       <ol>
        <li> Let <var>removedAttributes</var> be the list of attributes in
            the range indicated by the Service Changed characteristic
            that the UA had discovered before the Indication. 
        <li> Use the <a data-link-type="dfn" href="#primary-service-discovery" id="ref-for-primary-service-discovery">Primary Service Discovery</a>, <a data-link-type="dfn" href="#relationship-discovery" id="ref-for-relationship-discovery">Relationship Discovery</a>, <a data-link-type="dfn" href="#characteristic-discovery" id="ref-for-characteristic-discovery">Characteristic Discovery</a>,
            and <a data-link-type="dfn" href="#characteristic-descriptor-discovery" id="ref-for-characteristic-descriptor-discovery①">Characteristic Descriptor Discovery</a> procedures
            to re-discover attributes in the range indicated by the Service Changed characteristic.
            The UA MAY skip discovering all or part of the indicated range
            if it can prove that the results of that discovery
            could not affect the events fired below. 
        <li> Let <var>addedAttributes</var> be the list of attributes discovered in the previous step. 
        <li>
          If an attribute with the same definition
            (see the <a data-link-type="dfn" href="#service-interoperability-requirements" id="ref-for-service-interoperability-requirements">Service Interoperability Requirements</a>),
            ignoring Characteristic and Descriptor values,
            appears in both <var>removedAttributes</var> and <var>addedAttributes</var>,
            remove it from both. 
         <div class="example" id="example-changed-service">
          <a class="self-link" href="#example-changed-service"></a> 
          <p> Given the following device states: </p>
          <dl>
           <dt>State 1
           <dd>
            <ul>
             <li>
              Service A 
              <ul>
               <li>Characteristic C: value <code>[1, 2, 3]</code>
              </ul>
             <li>Service B
            </ul>
           <dt>State 2
           <dd>
            <ul>
             <li>
              Service A 
              <ul>
               <li>Characteristic C: value <code>[3, 2, 1]</code>
              </ul>
             <li>Service B
            </ul>
           <dt>State 3
           <dd>
            <ul>
             <li>
              Service A 
              <ul>
               <li>Characteristic D: value <code>[3, 2, 1]</code>
              </ul>
             <li>Service B
            </ul>
           <dt>State 4
           <dd>
            <ul>
             <li>
              Service A 
              <ul>
               <li>Characteristic C: value <code>[1, 2, 3]</code>
              </ul>
             <li>
              Service B 
              <ul>
               <li>Include Service A
              </ul>
            </ul>
          </dl>
          <p> A transition from state 1 to 2 leaves service A with
                "the same definition, ignoring Characteristic and Descriptor values",
                which means it’s removed from both <var>removedAttributes</var> and <var>addedAttributes</var>,
                and it wouldn’t appear in any <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged">servicechanged</a></code> events. </p>
          <p> A transition from state 1 to 3 leaves service A with a different definition,
                because a <a data-link-type="dfn" href="#service-definition" id="ref-for-service-definition">service definition</a> includes its characteristic definitions,
                so it’s left in both <var>removedAttributes</var> and <var>addedAttributes</var>.
                Then in <a href="#same-service-removed-and-added">step 8</a>,
                the service is moved to <var>changedServices</var>,
                which makes it cause a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged①">servicechanged</a></code> event
                instead of both a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded①">serviceadded</a></code> and <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved">serviceremoved</a></code>. <a href="#characteristic-descriptor-change-adds-changed-service">Step 9</a> also adds service A to <var>changedServices</var> because
                characteristic C was removed and characteristic D was added. </p>
          <p> A transition from state 1 to 4 is similar to the 1->3 transition.
                Service B is moved to <var>changedServices</var> in <a href="#same-service-removed-and-added">step 8</a>,
                but no characteristics or descriptors have changed,
                so it’s not redundantly added in <a href="#characteristic-descriptor-change-adds-changed-service">step 9</a>. </p>
         </div>
        <li> Let <var>invalidatedAttributes</var> be
            the attributes in <var>removedAttributes</var> but not <var>addedAttributes</var>. 
        <li>
          For each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a> <var>settings</var> in the UA, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑥">queue a task</a> on its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop③">responsible event loop</a> to
            do the following sub-steps: 
         <ol>
          <li> For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑥">BluetoothRemoteGATTService</a></code> <var>service</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object④">relevant settings object</a> is <var>settings</var>,
                if <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot③">[[representedService]]</a></code></code> is in <var>invalidatedAttributes</var>,
                set <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot④">[[representedService]]</a></code></code> to <code>null</code>. 
          <li> For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②⑥">BluetoothRemoteGATTCharacteristic</a></code> <var>characteristic</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑤">relevant settings object</a> is <var>settings</var>,
                if <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑧">[[representedCharacteristic]]</a></code></code> is in <var>invalidatedAttributes</var>,
                set <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑨">[[representedCharacteristic]]</a></code></code> to <code>null</code>. 
          <li> For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①⑤">BluetoothRemoteGATTDescriptor</a></code> <var>descriptor</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑥">relevant settings object</a> is <var>settings</var>,
                if <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑤">[[representedDescriptor]]</a></code></code> is in <var>invalidatedAttributes</var>,
                set <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑥">[[representedDescriptor]]</a></code></code> to <code>null</code>. 
          <li> Let <var>global</var> be <var>settings</var>’ <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global">global object</a>. 
          <li> Remove every entry
                from <code><var>global</var>.navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot④">[[attributeInstanceMap]]</a></code></code> that represents an attribute that
                is in <var>invalidatedAttributes</var>. 
         </ol>
        <li> Let <var>changedServices</var> be a set of <a data-link-type="dfn" href="#service" id="ref-for-service①①">Service</a>s, initially empty. 
        <li id="same-service-removed-and-added"><a class="self-link" href="#same-service-removed-and-added"></a> If the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute④">same</a> <a data-link-type="dfn" href="#service" id="ref-for-service①②">Service</a> appears in
            both <var>removedAttributes</var> and <var>addedAttributes</var>,
            remove it from both, and add it to <var>changedServices</var>. 
        <li id="characteristic-descriptor-change-adds-changed-service"><a class="self-link" href="#characteristic-descriptor-change-adds-changed-service"></a> For each <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①③">Characteristic</a> and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑧">Descriptor</a> in <var>removedAttributes</var> or <var>addedAttributes</var>,
            remove it from its original list,
            and add its parent <a data-link-type="dfn" href="#service" id="ref-for-service①③">Service</a> to <var>changedServices</var>. <span class="note">After this point, <var>removedAttributes</var> and <var>addedAttributes</var> contain only <a data-link-type="dfn" href="#service" id="ref-for-service①④">Service</a>s.</span> 
        <li id="only-notify-for-requested-services"><a class="self-link" href="#only-notify-for-requested-services"></a> If a <a data-link-type="dfn" href="#service" id="ref-for-service①⑤">Service</a> in <var>addedAttributes</var> would not have been returned from any previous call to <code>getPrimaryService</code>, <code>getPrimaryServices</code>, <code>getIncludedService</code>, or <code>getIncludedServices</code> if it had existed at the time of the call,
            the UA MAY remove the <a data-link-type="dfn" href="#service" id="ref-for-service①⑥">Service</a> from <var>addedAttributes</var>. 
        <li> Let <var>changedDevices</var> be the set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑥">Bluetooth device</a>s that
            contain any <a data-link-type="dfn" href="#service" id="ref-for-service①⑦">Service</a> in <var>removedAttributes</var>, <var>addedAttributes</var>, and <var>changedServices</var>. 
        <li>
          For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④①">BluetoothDevice</a></code> <var>deviceObj</var> that is connected to a device in <var>changedDevices</var>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑦">queue a task</a> on its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global①">relevant global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop④">responsible event loop</a> to do the following steps: 
         <ol>
          <li>
            For each <a data-link-type="dfn" href="#service" id="ref-for-service①⑧">Service</a> <var>service</var> in <var>removedAttributes</var>: 
           <ol>
            <li> If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑧">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑤">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved①">serviceremoved</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑦">BluetoothRemoteGATTService</a></code> representing the <a data-link-type="dfn" href="#service" id="ref-for-service①⑨">Service</a>. 
            <li> Remove this <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑧">BluetoothRemoteGATTService</a></code> from the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree④">Bluetooth tree</a>. 
           </ol>
          <li> For each <a data-link-type="dfn" href="#service" id="ref-for-service②⓪">Service</a> in <var>addedAttributes</var>,
                if <code>deviceObj.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑨">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID,
                add the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑨">BluetoothRemoteGATTService</a></code> representing this <a data-link-type="dfn" href="#service" id="ref-for-service②①">Service</a> to the <a data-link-type="dfn" href="#bluetooth-tree" id="ref-for-bluetooth-tree⑤">Bluetooth tree</a> and then <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑥">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded②">serviceadded</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice③⓪">BluetoothRemoteGATTService</a></code>. 
          <li> For each <a data-link-type="dfn" href="#service" id="ref-for-service②②">Service</a> in <var>changedServices</var>,
                if <code>deviceObj.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①⓪">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑦">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged②">servicechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice③①">BluetoothRemoteGATTService</a></code> representing the <a data-link-type="dfn" href="#service" id="ref-for-service②③">Service</a>. 
         </ol>
       </ol>
      </div>
     </section>
     <section>
      <h4 class="heading settled" data-level="5.6.6" id="idl-event-handlers"><span class="secno">5.6.6. </span><span class="content">IDL event handlers</span><a class="self-link" href="#idl-event-handlers"></a></h4>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="characteristiceventhandlers"><code><c- g>CharacteristicEventHandlers</c-></code></dfn> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged" id="ref-for-dom-characteristiceventhandlers-oncharacteristicvaluechanged"><c- g>oncharacteristicvaluechanged</c-></a>;
};
</pre>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="CharacteristicEventHandlers" data-dfn-type="attribute" data-export id="dom-characteristiceventhandlers-oncharacteristicvaluechanged"><code>oncharacteristicvaluechanged</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged③">characteristicvaluechanged</a></code> event type. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①②"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothdeviceeventhandlers"><code><c- g>BluetoothDeviceEventHandlers</c-></code></dfn> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived" id="ref-for-dom-bluetoothdeviceeventhandlers-onadvertisementreceived"><c- g>onadvertisementreceived</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected" id="ref-for-dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"><c- g>ongattserverdisconnected</c-></a>;
};
</pre>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="attribute" data-export id="dom-bluetoothdeviceeventhandlers-onadvertisementreceived"><code>onadvertisementreceived</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes①">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-advertisementreceived" id="ref-for-eventdef-bluetoothdevice-advertisementreceived③">advertisementreceived</a></code> event type. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="attribute" data-export id="dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"><code>ongattserverdisconnected</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes②">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdevice-gattserverdisconnected" id="ref-for-eventdef-bluetoothdevice-gattserverdisconnected②">gattserverdisconnected</a></code> event type. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①③"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="serviceeventhandlers"><code><c- g>ServiceEventHandlers</c-></code></dfn> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceadded" id="ref-for-dom-serviceeventhandlers-onserviceadded"><c- g>onserviceadded</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onservicechanged" id="ref-for-dom-serviceeventhandlers-onservicechanged"><c- g>onservicechanged</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceremoved" id="ref-for-dom-serviceeventhandlers-onserviceremoved"><c- g>onserviceremoved</c-></a>;
};
</pre>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onserviceadded"><code>onserviceadded</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes③">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded③">serviceadded</a></code> event type. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onservicechanged"><code>onservicechanged</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes④">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged③">servicechanged</a></code> event type. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onserviceremoved"><code>onserviceremoved</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes⑤">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved②">serviceremoved</a></code> event type. </p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.7" id="error-handling"><span class="secno">5.7. </span><span class="content">Error handling</span><a class="self-link" href="#error-handling"></a></h3>
     <p class="note" role="note"> This section primarily defines the mapping from system errors to Javascript error names
      and allows UAs to retry certain operations.
      The retry logic and possible error distinctions
      are highly constrained by the operating system,
      so places these requirements don’t reflect reality
      are likely <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues">spec bugs</a> instead of browser bugs. </p>
     <div class="algorithm" data-algorithm="error handling">
      <p> When the UA is using a <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure②">GATT procedure</a> to execute a step in an algorithm or to handle a query to the <a data-link-type="dfn" href="#bluetooth-cache" id="ref-for-bluetooth-cache⑤">Bluetooth cache</a> (both referred to as a "step", here),
        and the GATT procedure returns an <code><a data-link-type="dfn" href="#error-response" id="ref-for-error-response">Error Response</a></code>,
        the UA MUST perform the following steps: </p>
      <ol>
       <li> If the <a data-link-type="dfn" href="#procedure-timeouts" id="ref-for-procedure-timeouts">procedure times out</a> or
          the ATT Bearer (described in <a data-link-type="dfn" href="#profile-fundamentals" id="ref-for-profile-fundamentals">Profile Fundamentals</a>) is
          absent or terminated for any reason,
          return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror" id="ref-for-networkerror②⑦">NetworkError</a></code> from the step and abort these steps. 
       <li>
         Take the following actions depending on the <code>Error Code</code>: 
        <dl class="switch">
         <dt><code>Invalid PDU</code>
         <dt><code>Invalid Offset</code>
         <dt><code>Attribute Not Found</code>
         <dt><code>Unsupported Group Type</code>
         <dd> These error codes indicate that something unexpected happened at the protocol layer,
              likely either due to a UA or device bug.
              Return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror④">NotSupportedError</a></code> from the step. 
         <dt><code>Invalid Handle</code>
         <dd> Return an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑧">InvalidStateError</a></code> from the step. 
         <dt><code>Invalid Attribute Value Length</code>
         <dd> Return an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror" id="ref-for-invalidmodificationerror②">InvalidModificationError</a></code> from the step. 
         <dt><code>Attribute Not Long</code>
         <dd>
          <p> If this error code is received without having used a "Long" sub-procedure,
                this may indicate a device bug.
                Return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror⑤">NotSupportedError</a></code> from the step. </p>
          <p> Otherwise, retry the step without using a "Long" sub-procedure.
                If this is impossible due to the length of the value being written,
                return an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror" id="ref-for-invalidmodificationerror③">InvalidModificationError</a></code> from the step. </p>
         <dt><code>Insufficient Authentication</code>
         <dt><code>Insufficient Encryption</code>
         <dt><code>Insufficient Encryption Key Size</code>
         <dd> The UA SHOULD attempt to increase the security level of the connection.
              If this attempt fails or the UA doesn’t support any higher security,
              Return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①②">SecurityError</a></code> from the step.
              Otherwise, retry the step at the new higher security level. 
         <dt><code>Insufficient Authorization</code>
         <dd> Return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①③">SecurityError</a></code> from the step. 
         <dt><code>Application Error</code>
         <dd> If the GATT procedure was a Write,
              return an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror" id="ref-for-invalidmodificationerror④">InvalidModificationError</a></code> from the step.
              Otherwise, return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror⑥">NotSupportedError</a></code> from the step. 
         <dt><code>Read Not Permitted</code>
         <dt><code>Write Not Permitted</code>
         <dt><code>Request Not Supported</code>
         <dt><code>Prepare Queue Full</code>
         <dt><code>Insufficient Resources</code>
         <dt><code>Unlikely Error</code>
         <dt>Anything else
         <dd> Return a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror⑦">NotSupportedError</a></code> from the step. 
        </dl>
      </ol>
     </div>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="6" id="uuids"><span class="secno">6. </span><span class="content">UUIDs</span><a class="self-link" href="#uuids"></a></h2>
<pre class="idl highlight def"><c- b>typedef</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①②"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-uuid"><code><c- g>UUID</c-></code></dfn>;</pre>
    <p> A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid③">UUID</a> string represents a 128-bit <a data-link-type="biblio" href="#biblio-rfc4122">[RFC4122]</a> UUID.
    A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="valid-uuid">valid UUID</dfn> is a string that matches
    the <a data-link-type="biblio" href="#biblio-ecmascript">[ECMAScript]</a> regexp <code>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/</code>.
    That is, a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid">valid UUID</a> is lower-case and
    does not use the 16- or 32-bit abbreviations defined by the Bluetooth standard.
    All UUIDs returned from functions and attributes in this specification
    MUST be <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid①">valid UUID</a>s.
    If a function in this specification takes a parameter whose type is <a data-link-type="dfn" href="#uuid" id="ref-for-uuid④">UUID</a> or a dictionary including a <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑤">UUID</a> attribute,
    and the argument passed in any <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑥">UUID</a> slot is not a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid②">valid UUID</a>,
    the function MUST return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②②">a promise rejected with</a> a <code>TypeError</code> and abort its other steps. </p>
    <p class="note" role="note"> This standard provides the <code>BluetoothUUID.<a data-link-type="functionish" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid">canonicalUUID(<var>alias</var>)</a></code> function
    to map a 16- or 32-bit Bluetooth <a data-link-type="dfn" href="#uuid-alias" id="ref-for-uuid-alias">UUID alias</a> to its 128-bit form. </p>
    <p class="note" role="note"> Bluetooth devices are required to convert 16- and 32-bit UUIDs to 128-bit UUIDs
    before comparing them (as described in <a data-link-type="dfn" href="#attribute-type" id="ref-for-attribute-type">Attribute Type</a>), but not all devices do so.
    To interoperate with these devices,
    if the UA has received a UUID from the device in one form (16-, 32-, or 128-bit),
    it should send other aliases of that UUID back to the device in the same form. </p>
    <section>
     <h3 class="heading settled" data-level="6.1" id="standardized-uuids"><span class="secno">6.1. </span><span class="content">Standardized UUIDs</span><a class="self-link" href="#standardized-uuids"></a></h3>
     <p> The Bluetooth SIG maintains a registry at <a data-link-type="biblio" href="#biblio-bluetooth-assigned">[BLUETOOTH-ASSIGNED]</a> of
      UUIDs that identify services, characteristics, descriptors, and other entities.
      This section provides a way for script to look up those UUIDs by name
      so they don’t need to be replicated in each application. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①②"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <dfn class="idl-code" data-dfn-type="interface" data-export id="bluetoothuuid"><code><c- g>BluetoothUUID</c-></code><a class="self-link" href="#bluetoothuuid"></a></dfn> {
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑦"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①①"><c- g>getService</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①③"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long①"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getService(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getservice-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getservice-name-name"></a></dfn>);
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑧"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic②"><c- g>getCharacteristic</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①④"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long②"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getCharacteristic(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getcharacteristic-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getcharacteristic-name-name"></a></dfn>);
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑨"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor②"><c- g>getDescriptor</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑤"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long③"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getDescriptor(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getdescriptor-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getdescriptor-name-name"></a></dfn>);

  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①⓪"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid①"><c- g>canonicalUUID</c-></a>([<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#EnforceRange" id="ref-for-EnforceRange"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long④"><c- b>unsigned</c-> <c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothUUID/canonicalUUID(alias)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-canonicaluuid-alias-alias"><code><c- g>alias</c-></code><a class="self-link" href="#dom-bluetoothuuid-canonicaluuid-alias-alias"></a></dfn>);
};

<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑥"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑤"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑧"><c- g>BluetoothServiceUUID</c-></a>;
<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑦"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑥"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid②"><c- g>BluetoothCharacteristicUUID</c-></a>;
<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑧"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑦"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid②"><c- g>BluetoothDescriptorUUID</c-></a>;
</pre>
     <p> The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export id="dom-bluetoothuuid-canonicaluuid"><code>canonicalUUID(<var>alias</var>)</code></dfn></code> method, when invoked,
      MUST return <a data-link-type="dfn" href="#the-128-bit-uuid-represented" id="ref-for-the-128-bit-uuid-represented">the 128-bit UUID represented</a> by the 16- or 32-bit UUID alias <var>alias</var>. </p>
     <p class="note" role="note"> This algorithm consists of
      replacing the top 32 bits of "<code>00000000-0000-1000-8000-00805f9b34fb</code>"
      with the bits of the alias.
      For example, <code>canonicalUUID(0xDEADBEEF)</code> returns <code>"deadbeef-0000-1000-8000-00805f9b34fb"</code>. </p>
     <div class="note" role="note">
      <p> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothserviceuuid"><code>BluetoothServiceUUID</code></dfn> represents
        16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid③">valid UUID</a>s,
        and names defined in <a data-link-type="biblio" href="#biblio-bluetooth-assigned-services">[BLUETOOTH-ASSIGNED-SERVICES]</a>,
        or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①②">BluetoothUUID.getService()</a></code> does not throw an exception. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothcharacteristicuuid"><code>BluetoothCharacteristicUUID</code></dfn> represents
        16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid④">valid UUID</a>s,
        and names defined in <a data-link-type="biblio" href="#biblio-bluetooth-assigned-characteristics">[BLUETOOTH-ASSIGNED-CHARACTERISTICS]</a>,
        or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic③">BluetoothUUID.getCharacteristic()</a></code> does not throw an exception. </p>
      <p> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothdescriptoruuid"><code>BluetoothDescriptorUUID</code></dfn> represents
        16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑤">valid UUID</a>s,
        and names defined in <a data-link-type="biblio" href="#biblio-bluetooth-assigned-descriptors">[BLUETOOTH-ASSIGNED-DESCRIPTORS]</a>,
        or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor③">BluetoothUUID.getDescriptor()</a></code> does not throw an exception. </p>
     </div>
     <div class="algorithm" data-algorithm="ResolveUUIDName">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="resolveuuidname">ResolveUUIDName</dfn>(<var>name</var>, <var>assigned numbers table</var>, <var>prefix</var>),
        the UA MUST perform the following steps: </p>
      <ol>
       <li> If <var>name</var> is an <code>unsigned long</code>,
          return <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid②">BluetoothUUID.canonicalUUID</a></code>(name) and abort these steps. 
       <li> If <var>name</var> is a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑥">valid UUID</a>,
          return <var>name</var> and abort these steps. 
       <li> If the string <code><var>prefix</var> + "." + <var>name</var></code> appears in <var>assigned numbers table</var>,
          let <var>alias</var> be its assigned number,
          and return <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid③">BluetoothUUID.canonicalUUID</a></code>(<var>alias</var>). 
       <li> Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①④">TypeError</a></code>. 
      </ol>
     </div>
     <p> The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export id="dom-bluetoothuuid-getservice"><code>getService(<var>name</var>)</code></dfn></code> method, when invoked,
      MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="biblio" href="#biblio-bluetooth-assigned-services">[BLUETOOTH-ASSIGNED-SERVICES]</a>, "org.bluetooth.service"). </p>
     <p> The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export id="dom-bluetoothuuid-getcharacteristic"><code>getCharacteristic(<var>name</var>)</code></dfn></code> method, when invoked,
      MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname①">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="biblio" href="#biblio-bluetooth-assigned-characteristics">[BLUETOOTH-ASSIGNED-CHARACTERISTICS]</a>, "org.bluetooth.characteristic"). </p>
     <p> The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export id="dom-bluetoothuuid-getdescriptor"><code>getDescriptor(<var>name</var>)</code></dfn></code> method, when invoked,
      MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname②">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="biblio" href="#biblio-bluetooth-assigned-descriptors">[BLUETOOTH-ASSIGNED-DESCRIPTORS]</a>, "org.bluetooth.descriptor"). </p>
     <div class="example" id="example-650faeb7">
      <a class="self-link" href="#example-650faeb7"></a> 
      <p> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①③">BluetoothUUID.getService</a></code>("<a data-link-type="idl" href="https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.cycling_power.xml#" id="termref-for-①①"> cycling_power</a>")</code> returns <code>"00001818-0000-1000-8000-00805f9b34fb"</code>. </p>
      <p> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①④">BluetoothUUID.getService</a></code>("00001801-0000-1000-8000-00805f9b34fb")</code> returns <code>"00001801-0000-1000-8000-00805f9b34fb"</code>. </p>
      <p> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑤">BluetoothUUID.getService</a></code>("unknown-service")</code> throws a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⑤">TypeError</a></code>. </p>
      <p> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic④">BluetoothUUID.getCharacteristic</a></code>("<code class="idl"><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list.xml#" id="termref-for-①②">ieee_11073-20601_regulatory_certification_data_list</a></code>")</code> returns <code>"00002a2a-0000-1000-8000-00805f9b34fb"</code>. </p>
      <p> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor④">BluetoothUUID.getDescriptor</a></code>("<code class="idl"><a data-link-type="idl" href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml#" id="termref-for-①③">gatt.characteristic_presentation_format</a></code>")</code> returns <code>"00002904-0000-1000-8000-00805f9b34fb"</code>. </p>
     </div>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="7" id="the-gatt-blocklist"><span class="secno">7. </span><span class="content">The GATT Blocklist</span><a class="self-link" href="#the-gatt-blocklist"></a></h2>
    <p> This specification relies on a blocklist file in the <a href="https://github.com/WebBluetoothCG/registries"> https://github.com/WebBluetoothCG/registries</a> repository
    to restrict the set of GATT attributes a website can access. </p>
    <div class="algorithm" data-algorithm="parsing the blocklist">
     <p> The result of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-blocklist">parsing the blocklist</dfn> at a URL <var>url</var> is a map from <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑦">valid UUID</a>s to tokens, or an error,
      produced by the following algorithm: </p>
     <ol>
      <li>Fetch <var>url</var>, and let <var>contents</var> be its body, decoded as UTF-8.
      <li>Let <var>lines</var> be <var>contents</var> split on <code>'\n'</code>.
      <li> Let <var>result</var> be an empty map. 
      <li>
        For each <var>line</var> in <var>lines</var>, do the following sub-steps: 
       <ol>
        <li> If <var>line</var> is empty or its first character is <code>'#'</code>,
            continue to the next line. 
        <li> If <var>line</var> consists of just a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑧">valid UUID</a>,
            let <var>uuid</var> be that UUID and
            let <var>token</var> be "<code>exclude</code>". 
        <li> If <var>line</var> consists of a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑨">valid UUID</a>, a space (U+0020),
            and one of the tokens "<code>exclude-reads</code>" or "<code>exclude-writes</code>",
            let <var>uuid</var> be that UUID and
            let <var>token</var> be that token. 
        <li> Otherwise, return an error and abort these steps. 
        <li> If <var>uuid</var> is already in <var>result</var>,
            return an error and abort these steps. 
        <li> Add a mapping in <var>result</var> from <var>uuid</var> to <var>token</var>. 
       </ol>
      <li>Return <var>result</var>.
     </ol>
    </div>
    <p> The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-blocklist">GATT blocklist</dfn> is the result of <a data-link-type="dfn" href="#parsing-the-blocklist" id="ref-for-parsing-the-blocklist">parsing the blocklist</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt"> https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt</a>.
    The UA should re-fetch the blocklist periodically, but it’s unspecified how often. </p>
    <p> A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑦">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted">blocklisted</dfn> if either
    the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist①">GATT blocklist</a>’s value is an error,
    or the UUID maps to "<code>exclude</code>" in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist②">GATT blocklist</a>. </p>
    <p> A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑧">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-for-reads">blocklisted for reads</dfn> if either
    the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist③">GATT blocklist</a>’s value is an error,
    or the UUID maps to either "<code>exclude</code>" or "<code>exclude-reads</code>"
    in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist④">GATT blocklist</a>. </p>
    <p> A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑨">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-for-writes">blocklisted for writes</dfn> if either
    the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist⑤">GATT blocklist</a>’s value is an error,
    or the UUID maps to either "<code>exclude</code>" or "<code>exclude-writes</code>"
    in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist⑥">GATT blocklist</a>. </p>
   </section>
   <section>
    <h2 class="heading settled" data-level="8" id="navigator-extensions"><span class="secno">8. </span><span class="content">Extensions to the Navigator Interface</span><a class="self-link" href="#navigator-extensions"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①④"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑧"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①①"><c- n>Bluetooth</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Navigator" data-dfn-type="attribute" data-export data-readonly data-type="Bluetooth" id="dom-navigator-bluetooth"><code><c- g>bluetooth</c-></code></dfn>;
};
</pre>
   </section>
   <section>
    <h2 class="heading settled" data-level="9" id="terminology"><span class="secno">9. </span><span class="content">Terminology and Conventions</span><a class="self-link" href="#terminology"></a></h2>
    <p> This specification uses a few conventions and several terms from other specifications.
    This section lists those and links to their primary definitions. </p>
    <p> When an algorithm in this specification uses a name defined in this or another specification,
    the name MUST resolve to its initial value,
    ignoring any changes that have been made to the name in the current execution environment.
    For example, when the <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice⑥">requestDevice()</a></code> algorithm says to call <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map②">Array.prototype.map</a></code>.call(<var>filter</var>.services, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑥">BluetoothUUID.getService</a></code>)</code>,
    this MUST apply the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map③">Array.prototype.map</a></code> algorithm defined in <a data-link-type="biblio" href="#biblio-ecmascript">[ECMAScript]</a> with <code><var>filter</var>.services</code> as its <code>this</code> parameter and
    the algorithm defined in <a href="#standardized-uuids">§ 6.1 Standardized UUIDs</a> for <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑦">BluetoothUUID.getService</a></code> as its <code>callbackfn</code> parameter,
    regardless of any modifications that have been made to <code>window</code>, <code>Array</code>, <code>Array.prototype</code>, <code>Array.prototype.map</code>, <code>Function</code>, <code>Function.prototype</code>, <code>BluetoothUUID</code>, <code>BluetoothUUID.getService</code>, or other objects. </p>
    <p> This specification uses a read-only type
    that is similar to WebIDL’s <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array⑤">FrozenArray</a></code>. </p>
    <ul>
     <li> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-only-arraybuffer">read only ArrayBuffer</dfn> has <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑨">ArrayBuffer</a></code>'s values and interface,
      except that attempting to write to its contents or transfer it
      has the same effect as trying to write to a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-frozen-array" id="ref-for-idl-frozen-array⑥">FrozenArray</a></code>'s contents.
      This applies to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-typedarray-constructors" id="ref-for-sec-typedarray-constructors">TypedArray</a></code>s and <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⑥">DataView</a></code>s
      wrapped around the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor①⓪">ArrayBuffer</a></code> too. 
    </ul>
    <dl>
     <dt><a data-link-type="biblio" href="#biblio-bluetooth42">[BLUETOOTH42]</a>
     <dd>
      <ol>
       <li value="1">
        Architecture &amp; Terminology Overview 
        <ol type="A">
         <li value="1">
          General Description 
          <ol>
           <li value="2">Overview of Bluetooth Low Energy Operation
                  (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="advertising event|advertising events" data-noexport id="advertising-event">advertising events</dfn>) 
          </ol>
         <li value="4">
          Communication Topology and Operation 
          <ol>
           <li value="2">
            Operational Procedures and Modes 
            <ol>
             <li value="1">
              BR/EDR Procedures 
              <ol>
               <li value="1">
                Inquiry (Discovering) Procedure 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="extended-inquiry-response">Extended Inquiry Response</dfn>
                </ol>
              </ol>
            </ol>
          </ol>
        </ol>
       <li value="2">
        Core System Package [BR/EDR Controller volume] 
        <ol type="A">
         <li value="5">
          Host Controller Interface Functional Specification 
          <ol>
           <li value="7">
            HCI Commands and Events 
            <ol>
             <li value="4">
              Informational Parameters 
              <ol>
               <li value="6"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-bd_addr-command">Read BD_ADDR Command</dfn>
              </ol>
             <li value="5">
              Status Parameters 
              <ol>
               <li value="4"> Read <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="RSSI|Received Signal Strength" data-noexport id="rssi"> <abbr title="Received Signal Strength Indication"> RSSI</abbr></dfn> Command 
              </ol>
            </ol>
          </ol>
        </ol>
       <li value="3">
        Core System Package [Host volume] 
        <ol type="A">
         <li value="2">
          Service Discovery Protocol (SDP) Specification 
          <ol>
           <li value="2">
            Overview 
            <ol>
             <li value="5">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="searching-for-services">Searching for Services</dfn> 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="uuid">UUID</dfn> (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="uuid-alias">UUID alias</dfn>es and
                          the algorithm to compute <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="the-128-bit-uuid-represented">the 128-bit UUID represented</dfn> by a UUID alias) 
              </ol>
            </ol>
          </ol>
         <li value="3">
          Generic Access Profile 
          <ol>
           <li value="2">
            Profile Overview 
            <ol>
             <li value="2">
              Profile Roles 
              <ol>
               <li value="2">
                Roles when Operating over an LE Physical Transport 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="broadcaster">Broadcaster</dfn> Role
                 <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="observer">Observer</dfn> Role
                 <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="peripheral">Peripheral</dfn> Role
                 <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="central">Central</dfn> Role
                </ol>
              </ol>
            </ol>
           <li value="3">
            User Interface Aspects 
            <ol>
             <li value="2">
              Representation of Bluetooth Parameters 
              <ol>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bluetooth-device-name">Bluetooth Device Name</dfn> (the user-friendly name) 
              </ol>
            </ol>
           <li value="6">
            Idle Mode Procedures — BR/EDR Physical Transport 
            <ol>
             <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="device-discovery-procedure">Device Discovery Procedure</dfn>
             <li value="5"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="br-edr-bonding-procedure">BR/EDR Bonding Procedure</dfn>
            </ol>
           <li value="9">
            Operational Modes and Procedures — LE Physical Transport 
            <ol>
             <li value="1">
              Broadcast Mode and Observation Procedure 
              <ol>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="observation-procedure">Observation Procedure</dfn>
              </ol>
             <li value="2">
              Discovery Modes and Procedures 
              <ol>
               <li value="6"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="general-discovery-procedure">General Discovery Procedure</dfn>
               <li value="7"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="name-discovery-procedure">Name Discovery Procedure</dfn>
              </ol>
             <li value="3">Connection Modes and Procedures
             <li value="4">
              Bonding Modes and Procedures 
              <ol>
               <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="le-bonding-procedure">LE Bonding Procedure</dfn>
              </ol>
            </ol>
           <li value="10">
            Security Aspects — LE Physical Transport 
            <ol>
             <li value="7"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="privacy-feature">Privacy Feature</dfn>
             <li value="8">
              Random Device Address 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="static-address">Static Address</dfn>
               <li value="2">
                <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="private-address">Private address</dfn> 
                <ol>
                 <li value="3"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</dfn> 
                </ol>
              </ol>
            </ol>
           <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="advertising-data">Advertising Data</dfn> and Scan Response Data Format
                  (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ad-structure">AD structure</dfn>) 
           <li value="15">
            Bluetooth Device Requirements 
            <ol>
             <li value="1">
              Bluetooth Device Address (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bd_addr">BD_ADDR</dfn>) 
              <ol>
               <li value="1">
                Bluetooth Device Address Types 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="public-bluetooth-address">Public Bluetooth Address</dfn>
                </ol>
              </ol>
            </ol>
           <li value="16">Definitions
                  (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bond">bond</dfn>) 
          </ol>
         <li value="6">
          Attribute Protocol (ATT) 
          <ol>
           <li value="3">
            Protocol Requirements 
            <ol>
             <li value="2">
              Basic Concepts 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-type">Attribute Type</dfn>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-handle">Attribute Handle</dfn>
               <li value="9"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="long-attribute-values">Long Attribute Values</dfn>
              </ol>
             <li value="4">
              Attribute Protocol Pdus 
              <ol>
               <li value="1">
                Error Handling 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="error-response">Error Response</dfn>
                </ol>
              </ol>
            </ol>
          </ol>
         <li value="7">
          <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="Generic Attribute Profile|GATT" data-noexport id="generic-attribute-profile">Generic Attribute Profile</dfn> (GATT) 
          <ol>
           <li value="2">
            Profile Overview 
            <ol>
             <li value="2">Configurations and Roles
                      (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-client">GATT Client</dfn> and <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-server">GATT Server</dfn>) 
             <li value="4"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="profile-fundamentals">Profile Fundamentals</dfn>,
                      defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="att-bearer">ATT Bearer</dfn> 
             <li value="5">
              Attribute Protocol 
              <ol>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-caching">Attribute Caching</dfn>
              </ol>
             <li value="6">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-profile-hierarchy">GATT Profile Hierarchy</dfn> 
              <ol>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service">Service</dfn>
               <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="included-service">Included Service</dfn>s
               <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic">Characteristic</dfn>
              </ol>
            </ol>
           <li value="3">
            <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-interoperability-requirements">Service Interoperability Requirements</dfn> 
            <ol>
             <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-definition">Service Definition</dfn>
             <li value="3">
              Characteristic Definition 
              <ol>
               <li value="1">
                Characteristic Declaration 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-properties">Characteristic Properties</dfn>
                </ol>
               <li value="3">
                Characteristic <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="descriptor">Descriptor</dfn> Declarations 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-extended-properties">Characteristic Extended Properties</dfn>
                 <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="client-characteristic-configuration">Client Characteristic Configuration</dfn>
                </ol>
              </ol>
            </ol>
           <li value="4">
            GATT Feature Requirements — defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="GATT procedure|GATT procedures" data-noexport id="gatt-procedure">GATT procedures</dfn>. 
            <ol>
             <li value="3">
              Server Configuration 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="exchange-mtu">Exchange MTU</dfn>
              </ol>
             <li value="4">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="primary-service-discovery">Primary Service Discovery</dfn> 
              <ol>
               <li value="1">Discover All Primary Services
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</dfn>
              </ol>
             <li value="5">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="relationship-discovery">Relationship Discovery</dfn> 
              <ol>
               <li value="1">Find Included Services
              </ol>
             <li value="6">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-discovery">Characteristic Discovery</dfn> 
              <ol>
               <li value="1">Discover All Characteristics of a Service
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-characteristics-by-uuid">Discover Characteristics by UUID</dfn>
              </ol>
             <li value="7">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-descriptor-discovery">Characteristic Descriptor Discovery</dfn> 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</dfn>
              </ol>
             <li value="8"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-read">Characteristic Value Read</dfn>
             <li value="9">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-write">Characteristic Value Write</dfn> 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-without-response">Write Without Response</dfn>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-characteristic-value">Write Characteristic Value</dfn>
              </ol>
             <li value="10"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-notification">Characteristic Value Notification</dfn>
             <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-indications">Characteristic Value Indications</dfn>
             <li value="12">
              <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-descriptors">Characteristic Descriptors</dfn> 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-characteristic-descriptors">Read Characteristic Descriptors</dfn>
               <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-long-characteristic-descriptors">Read Long Characteristic Descriptors</dfn>
               <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-characteristic-descriptors">Write Characteristic Descriptors</dfn>
               <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-long-characteristic-descriptors">Write Long Characteristic Descriptors</dfn>
              </ol>
             <li value="14"><dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="procedure times out" data-noexport id="procedure-timeouts">Procedure Timeouts</dfn>
            </ol>
           <li value="6">
            <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gap-interoperability-requirements">GAP Interoperability Requirements</dfn> 
            <ol>
             <li value="1">
              BR/EDR GAP Interoperability Requirements 
              <ol>
               <li value="1">Connection Establishment
              </ol>
             <li value="2">
              LE GAP Interoperability Requirements 
              <ol>
               <li value="1">Connection Establishment
              </ol>
            </ol>
           <li value="7">
            Defined Generic Attribute Profile Service 
            <ol>
             <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-changed">Service Changed</dfn>
            </ol>
          </ol>
         <li value="8">
          Security Manager Specification 
          <ol>
           <li value="2">
            Security Manager 
            <ol>
             <li value="4">
              Security in Bluetooth Low Energy 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="definition-of-keys-and-values">Definition of Keys and Values</dfn>,
                          defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="Identity Resolving Key|IRK" data-noexport id="identity-resolving-key">Identity Resolving Key</dfn> (<abbr title="Identity Resolving Key">IRK</abbr>) 
              </ol>
            </ol>
          </ol>
        </ol>
       <li value="6">
        Core System Package [Low Energy Controller volume] 
        <ol type="A">
         <li value="2">
          Link Layer Specification 
          <ol>
           <li value="1">
            General Description 
            <ol>
             <li value="3">
              Device Address 
              <ol>
               <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="public-device-address">Public Device Address</dfn>
               <li value="2">
                Random Device Address 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="static-device-address">Static Device Address</dfn>
                </ol>
              </ol>
            </ol>
           <li value="4">
            Air Interface Protocol 
            <ol>
             <li value="4">
              Non-Connected States 
              <ol>
               <li value="3">
                Scanning State 
                <ol>
                 <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="passive-scanning">Passive Scanning</dfn>
                </ol>
              </ol>
            </ol>
          </ol>
        </ol>
      </ol>
     <dt><a data-link-type="biblio" href="#biblio-bluetooth-supplement6">[BLUETOOTH-SUPPLEMENT6]</a>
     <dd>
      <ol type="A">
       <li value="1">
        Data Types Specification 
        <ol>
         <li value="1">
          Data Types Definitions and Formats 
          <ol>
           <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="Service UUIDs" data-noexport id="service-uuid-data-type">Service UUID Data Type</dfn>
           <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="local-name-data-type">Local Name Data Type</dfn>
           <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="flags-data-type">Flags Data Type</dfn> (defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discoverable-mode">Discoverable Mode</dfn> flags)
           <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="manufacturer-specific-data">Manufacturer Specific Data</dfn>
           <li value="5"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="tx-power-level">TX Power Level</dfn>
           <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-data">Service Data</dfn>
           <li value="12"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="appearance">Appearance</dfn>
          </ol>
        </ol>
      </ol>
    </dl>
   </section>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li>
    acceptAllDevices
    <ul>
     <li><a href="#dom-bluetoothpermissiondescriptor-acceptalldevices">dict-member for BluetoothPermissionDescriptor</a><span>, in §3.1</span>
     <li><a href="#dom-requestdeviceoptions-acceptalldevices">dict-member for RequestDeviceOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#dom-bluetoothremotegattserver-activealgorithms-slot">[[activeAlgorithms]]</a><span>, in §5.2</span>
   <li><a href="#active-notification-context-set">active notification context set</a><span>, in §5.4</span>
   <li><a href="#ad-structure">AD structure</a><span>, in §9</span>
   <li><a href="#eventdef-bluetoothdevice-advertisementreceived">advertisementreceived</a><span>, in §5.6.2</span>
   <li><a href="#advertising-data">Advertising Data</a><span>, in §9</span>
   <li><a href="#advertising-event">advertising event</a><span>, in §9</span>
   <li><a href="#advertising-event">advertising events</a><span>, in §9</span>
   <li><a href="#dictdef-allowedbluetoothdevice">AllowedBluetoothDevice</a><span>, in §3.1</span>
   <li><a href="#dom-bluetoothpermissiondata-alloweddevices">allowedDevices</a><span>, in §3.1</span>
   <li><a href="#dom-bluetoothdevice-allowedservices-slot">[[allowedServices]]</a><span>, in §4.2</span>
   <li><a href="#dom-allowedbluetoothdevice-allowedservices">allowedServices</a><span>, in §3.1</span>
   <li><a href="#appearance">Appearance</a><span>, in §9</span>
   <li>
    appearance
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-appearance">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-appearance">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
    </ul>
   <li><a href="#att-bearer">ATT Bearer</a><span>, in §9</span>
   <li><a href="#attribute">Attribute</a><span>, in §5.1</span>
   <li><a href="#attribute-caching">Attribute Caching</a><span>, in §9</span>
   <li><a href="#attribute-handle">Attribute Handle</a><span>, in §9</span>
   <li><a href="#dom-bluetooth-attributeinstancemap-slot">[[attributeInstanceMap]]</a><span>, in §3</span>
   <li><a href="#attribute-type">Attribute Type</a><span>, in §9</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites">authenticatedSignedWrites</a><span>, in §5.4.1</span>
   <li><a href="#eventdef-bluetooth-availabilitychanged">availabilitychanged</a><span>, in §5.6.2</span>
   <li>
    [[BackingMap]]
    <ul>
     <li><a href="#dom-bluetoothmanufacturerdatamap-backingmap-slot">attribute for BluetoothManufacturerDataMap</a><span>, in §4.2.1.1</span>
     <li><a href="#dom-bluetoothservicedatamap-backingmap-slot">attribute for BluetoothServiceDataMap</a><span>, in §4.2.1.2</span>
    </ul>
   <li><a href="#bd_addr">BD_ADDR</a><span>, in §9</span>
   <li><a href="#blocklisted">blocklisted</a><span>, in §7</span>
   <li><a href="#blocklisted-for-reads">blocklisted for reads</a><span>, in §7</span>
   <li><a href="#blocklisted-for-writes">blocklisted for writes</a><span>, in §7</span>
   <li><a href="#bluetooth">Bluetooth</a><span>, in §3</span>
   <li><a href="#dom-navigator-bluetooth">bluetooth</a><span>, in §8</span>
   <li><a href="#dom-permissionname-bluetooth">"bluetooth"</a><span>, in §3.1</span>
   <li><a href="#bluetoothadvertisingevent">BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
   <li><a href="#dictdef-bluetoothadvertisingeventinit">BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
   <li><a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent">BluetoothAdvertisingEvent(type, init)</a><span>, in §4.2.1</span>
   <li><a href="#bluetooth-cache">Bluetooth cache</a><span>, in §5.1</span>
   <li><a href="#bluetoothcharacteristicproperties">BluetoothCharacteristicProperties</a><span>, in §5.4.1</span>
   <li><a href="#typedefdef-bluetoothcharacteristicuuid">BluetoothCharacteristicUUID</a><span>, in §6.1</span>
   <li><a href="#dictdef-bluetoothdatafilterinit">BluetoothDataFilterInit</a><span>, in §3</span>
   <li><a href="#typedefdef-bluetoothdescriptoruuid">BluetoothDescriptorUUID</a><span>, in §6.1</span>
   <li><a href="#bluetoothdevice">BluetoothDevice</a><span>, in §4</span>
   <li><a href="#bluetooth-device">Bluetooth device</a><span>, in §4.1</span>
   <li><a href="#bluetoothdeviceeventhandlers">BluetoothDeviceEventHandlers</a><span>, in §5.6.6</span>
   <li><a href="#bluetooth-device-name">Bluetooth Device Name</a><span>, in §9</span>
   <li><a href="#dictdef-bluetoothlescanfilterinit">BluetoothLEScanFilterInit</a><span>, in §3</span>
   <li><a href="#bluetoothmanufacturerdatamap">BluetoothManufacturerDataMap</a><span>, in §4.2.1</span>
   <li><a href="#dictdef-bluetoothpermissiondata">BluetoothPermissionData</a><span>, in §3.1</span>
   <li><a href="#dictdef-bluetoothpermissiondescriptor">BluetoothPermissionDescriptor</a><span>, in §3.1</span>
   <li><a href="#bluetoothpermissionresult">BluetoothPermissionResult</a><span>, in §3.1</span>
   <li><a href="#bluetoothremotegattcharacteristic">BluetoothRemoteGATTCharacteristic</a><span>, in §5</span>
   <li><a href="#bluetoothremotegattdescriptor">BluetoothRemoteGATTDescriptor</a><span>, in §5</span>
   <li><a href="#bluetoothremotegattserver">BluetoothRemoteGATTServer</a><span>, in §5</span>
   <li><a href="#bluetoothremotegattservice">BluetoothRemoteGATTService</a><span>, in §5</span>
   <li><a href="#bluetoothservicedatamap">BluetoothServiceDataMap</a><span>, in §4.2.1</span>
   <li><a href="#typedefdef-bluetoothserviceuuid">BluetoothServiceUUID</a><span>, in §6.1</span>
   <li><a href="#bluetooth-tree">Bluetooth Tree</a><span>, in §5.6</span>
   <li><a href="#bluetoothuuid">BluetoothUUID</a><span>, in §6.1</span>
   <li><a href="#bond">bond</a><span>, in §9</span>
   <li><a href="#br-edr-bonding-procedure">BR/EDR Bonding Procedure</a><span>, in §9</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-broadcast">broadcast</a><span>, in §5.4.1</span>
   <li><a href="#broadcaster">Broadcaster</a><span>, in §9</span>
   <li>
    canonicalizing
    <ul>
     <li><a href="#bluetoothdatafilterinit-canonicalizing">dfn for BluetoothDataFilterInit</a><span>, in §3</span>
     <li><a href="#bluetoothlescanfilterinit-canonicalizing">dfn for BluetoothLEScanFilterInit</a><span>, in §3</span>
    </ul>
   <li><a href="#dom-bluetoothuuid-canonicaluuid">canonicalUUID(alias)</a><span>, in §6.1</span>
   <li><a href="#central">Central</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattdescriptor-characteristic">characteristic</a><span>, in §5.5</span>
   <li><a href="#characteristic">Characteristic</a><span>, in §9</span>
   <li><a href="#characteristic-descriptor-discovery">Characteristic Descriptor Discovery</a><span>, in §9</span>
   <li><a href="#characteristic-descriptors">Characteristic Descriptors</a><span>, in §9</span>
   <li><a href="#characteristic-discovery">Characteristic Discovery</a><span>, in §9</span>
   <li><a href="#characteristiceventhandlers">CharacteristicEventHandlers</a><span>, in §5.6.6</span>
   <li><a href="#characteristic-extended-properties">Characteristic Extended Properties</a><span>, in §9</span>
   <li><a href="#characteristic-properties">Characteristic Properties</a><span>, in §9</span>
   <li><a href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged">characteristicvaluechanged</a><span>, in §5.6.2</span>
   <li><a href="#characteristic-value-indications">Characteristic Value Indications</a><span>, in §9</span>
   <li><a href="#characteristic-value-notification">Characteristic Value Notification</a><span>, in §9</span>
   <li><a href="#characteristic-value-read">Characteristic Value Read</a><span>, in §9</span>
   <li><a href="#characteristic-value-write">Characteristic Value Write</a><span>, in §9</span>
   <li><a href="#clean-up-the-disconnected-device">clean up the disconnected device</a><span>, in §5.6.3</span>
   <li><a href="#client-characteristic-configuration">Client Characteristic Configuration</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattserver-connect">connect()</a><span>, in §5.2</span>
   <li><a href="#dom-bluetoothremotegattserver-connected">connected</a><span>, in §5.2</span>
   <li><a href="#connection-checking-wrapper">connection-checking wrapper</a><span>, in §5.2</span>
   <li><a href="#dom-valueevent-valueevent">constructor(type)</a><span>, in §3.2</span>
   <li><a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent">constructor(type, init)</a><span>, in §4.2.1</span>
   <li><a href="#dom-valueevent-valueevent">constructor(type, initDict)</a><span>, in §3.2</span>
   <li><a href="#dom-bluetoothdevice-context-slot">[[context]]</a><span>, in §4.2</span>
   <li><a href="#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">create a BluetoothCharacteristicProperties instance from the Characteristic</a><span>, in §5.4.1</span>
   <li><a href="#create-a-bluetoothremotegattcharacteristic-representing">create a BluetoothRemoteGATTCharacteristic representing</a><span>, in §5.4</span>
   <li><a href="#create-a-bluetoothremotegattdescriptor-representing">create a BluetoothRemoteGATTDescriptor representing</a><span>, in §5.5</span>
   <li><a href="#create-a-bluetoothremotegattservice-representing">create a BluetoothRemoteGATTService representing</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothdatafilterinit-dataprefix">dataPrefix</a><span>, in §3</span>
   <li><a href="#definition-of-keys-and-values">Definition of Keys and Values</a><span>, in §9</span>
   <li><a href="#descriptor">Descriptor</a><span>, in §9</span>
   <li><a href="#dom-allowedbluetoothdevice-device-slot">[[device]]</a><span>, in §3.1</span>
   <li>
    device
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-device">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothremotegattserver-device">attribute for BluetoothRemoteGATTServer</a><span>, in §5.2</span>
     <li><a href="#dom-bluetoothremotegattservice-device">attribute for BluetoothRemoteGATTService</a><span>, in §5.3</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-device">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
    </ul>
   <li><a href="#device-discovery-procedure">Device Discovery Procedure</a><span>, in §9</span>
   <li>
    deviceId
    <ul>
     <li><a href="#dom-allowedbluetoothdevice-deviceid">dict-member for AllowedBluetoothDevice</a><span>, in §3.1</span>
     <li><a href="#dom-bluetoothpermissiondescriptor-deviceid">dict-member for BluetoothPermissionDescriptor</a><span>, in §3.1</span>
    </ul>
   <li><a href="#dom-bluetooth-deviceinstancemap-slot">[[deviceInstanceMap]]</a><span>, in §3</span>
   <li><a href="#dom-bluetoothpermissionresult-devices">devices</a><span>, in §3.1</span>
   <li><a href="#dom-bluetoothremotegattserver-disconnect">disconnect()</a><span>, in §5.2</span>
   <li><a href="#discoverable-mode">Discoverable Mode</a><span>, in §9</span>
   <li><a href="#discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</a><span>, in §9</span>
   <li><a href="#discover-characteristics-by-uuid">Discover Characteristics by UUID</a><span>, in §9</span>
   <li><a href="#discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</a><span>, in §9</span>
   <li><a href="#error-response">Error Response</a><span>, in §9</span>
   <li><a href="#exchange-mtu">Exchange MTU</a><span>, in §9</span>
   <li><a href="#extended-inquiry-response">Extended Inquiry Response</a><span>, in §9</span>
   <li>
    filters
    <ul>
     <li><a href="#dom-bluetoothpermissiondescriptor-filters">dict-member for BluetoothPermissionDescriptor</a><span>, in §3.1</span>
     <li><a href="#dom-requestdeviceoptions-filters">dict-member for RequestDeviceOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#fire-an-advertisementreceived-event">fire an advertisementreceived event</a><span>, in §4.2.1</span>
   <li><a href="#flags-data-type">Flags Data Type</a><span>, in §9</span>
   <li><a href="#gap-interoperability-requirements">GAP Interoperability Requirements</a><span>, in §9</span>
   <li><a href="#garbage-collect-the-connection">garbage-collect the connection</a><span>, in §5.2</span>
   <li><a href="#generic-attribute-profile">GATT</a><span>, in §9</span>
   <li><a href="#dom-bluetoothdevice-gatt-slot">[[gatt]]</a><span>, in §4.2</span>
   <li><a href="#dom-bluetoothdevice-gatt">gatt</a><span>, in §4.2</span>
   <li><a href="#gatt-blocklist">GATT blocklist</a><span>, in §7</span>
   <li><a href="#gatt-client">GATT Client</a><span>, in §9</span>
   <li><a href="#gatt-procedure">GATT procedure</a><span>, in §9</span>
   <li><a href="#gatt-procedure">GATT procedures</a><span>, in §9</span>
   <li><a href="#gatt-profile-hierarchy">GATT Profile Hierarchy</a><span>, in §9</span>
   <li><a href="#gatt-server">GATT Server</a><span>, in §9</span>
   <li><a href="#eventdef-bluetoothdevice-gattserverdisconnected">gattserverdisconnected</a><span>, in §5.6.2</span>
   <li><a href="#general-discovery-procedure">General Discovery Procedure</a><span>, in §9</span>
   <li><a href="#generic-attribute-profile">Generic Attribute Profile</a><span>, in §9</span>
   <li><a href="#dom-bluetooth-getavailability">getAvailability()</a><span>, in §3.2</span>
   <li><a href="#dom-bluetoothremotegattservice-getcharacteristic">getCharacteristic(characteristic)</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothuuid-getcharacteristic">getCharacteristic(name)</a><span>, in §6.1</span>
   <li><a href="#dom-bluetoothremotegattservice-getcharacteristics">getCharacteristics()</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothremotegattservice-getcharacteristics">getCharacteristics(characteristic)</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptor">getDescriptor(descriptor)</a><span>, in §5.4</span>
   <li><a href="#dom-bluetoothuuid-getdescriptor">getDescriptor(name)</a><span>, in §6.1</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptors">getDescriptors()</a><span>, in §5.4</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptors">getDescriptors(descriptor)</a><span>, in §5.4</span>
   <li><a href="#getgattchildren">GetGATTChildren</a><span>, in §5.1.3</span>
   <li><a href="#dom-bluetoothremotegattservice-getincludedservices">getIncludedServices()</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothremotegattservice-getincludedservice">getIncludedService(service)</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothremotegattservice-getincludedservices">getIncludedServices(service)</a><span>, in §5.3</span>
   <li><a href="#dom-bluetoothremotegattserver-getprimaryservices">getPrimaryServices()</a><span>, in §5.2</span>
   <li><a href="#dom-bluetoothremotegattserver-getprimaryservice">getPrimaryService(service)</a><span>, in §5.2</span>
   <li><a href="#dom-bluetoothremotegattserver-getprimaryservices">getPrimaryServices(service)</a><span>, in §5.2</span>
   <li><a href="#dom-bluetoothuuid-getservice">getService(name)</a><span>, in §6.1</span>
   <li><a href="#get-the-bluetoothdevice-representing">get the BluetoothDevice representing</a><span>, in §4.2</span>
   <li><a href="#dom-bluetoothdevice-id">id</a><span>, in §4.2</span>
   <li><a href="#identity-resolving-key">Identity Resolving Key</a><span>, in §9</span>
   <li><a href="#included-service">Included Service</a><span>, in §9</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-indicate">indicate</a><span>, in §5.4.1</span>
   <li><a href="#identity-resolving-key">IRK</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattservice-isprimary">isPrimary</a><span>, in §5.3</span>
   <li><a href="#le-bonding-procedure">LE Bonding Procedure</a><span>, in §9</span>
   <li><a href="#local-name-data-type">Local Name Data Type</a><span>, in §9</span>
   <li><a href="#long-attribute-values">Long Attribute Values</a><span>, in §9</span>
   <li>
    manufacturerData
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-manufacturerdata">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-manufacturerdata">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothlescanfilterinit-manufacturerdata">dict-member for BluetoothLEScanFilterInit</a><span>, in §3</span>
    </ul>
   <li><a href="#manufacturer-specific-data">Manufacturer Specific Data</a><span>, in §9</span>
   <li><a href="#dom-bluetoothdatafilterinit-mask">mask</a><span>, in §3</span>
   <li><a href="#matches-a-filter">match a filter</a><span>, in §3</span>
   <li><a href="#bluetoothdatafilterinit-matches">matches</a><span>, in §3</span>
   <li><a href="#matches-a-filter">matches a filter</a><span>, in §3</span>
   <li><a href="#matches-a-filter">matches any filter</a><span>, in §3</span>
   <li><a href="#dom-allowedbluetoothdevice-mayusegatt">mayUseGATT</a><span>, in §3.1</span>
   <li>
    name
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-name">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothdevice-name">attribute for BluetoothDevice</a><span>, in §4.2</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-name">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothlescanfilterinit-name">dict-member for BluetoothLEScanFilterInit</a><span>, in §3</span>
    </ul>
   <li><a href="#name-discovery-procedure">Name Discovery Procedure</a><span>, in §9</span>
   <li><a href="#dom-bluetoothlescanfilterinit-nameprefix">namePrefix</a><span>, in §3</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-notify">notify</a><span>, in §5.4.1</span>
   <li><a href="#observation-procedure">Observation Procedure</a><span>, in §9</span>
   <li><a href="#observer">Observer</a><span>, in §9</span>
   <li><a href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived">onadvertisementreceived</a><span>, in §5.6.6</span>
   <li><a href="#dom-bluetooth-onavailabilitychanged">onavailabilitychanged</a><span>, in §3</span>
   <li><a href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged">oncharacteristicvaluechanged</a><span>, in §5.6.6</span>
   <li><a href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected">ongattserverdisconnected</a><span>, in §5.6.6</span>
   <li><a href="#dom-serviceeventhandlers-onserviceadded">onserviceadded</a><span>, in §5.6.6</span>
   <li><a href="#dom-serviceeventhandlers-onservicechanged">onservicechanged</a><span>, in §5.6.6</span>
   <li><a href="#dom-serviceeventhandlers-onserviceremoved">onserviceremoved</a><span>, in §5.6.6</span>
   <li>
    optionalServices
    <ul>
     <li><a href="#dom-bluetoothpermissiondescriptor-optionalservices">dict-member for BluetoothPermissionDescriptor</a><span>, in §3.1</span>
     <li><a href="#dom-requestdeviceoptions-optionalservices">dict-member for RequestDeviceOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#parsing-the-blocklist">parsing the blocklist</a><span>, in §7</span>
   <li><a href="#passive-scanning">Passive Scanning</a><span>, in §9</span>
   <li><a href="#peripheral">Peripheral</a><span>, in §9</span>
   <li><a href="#populate-the-bluetooth-cache">populate the Bluetooth cache</a><span>, in §5.1.2</span>
   <li><a href="#primary-service-discovery">Primary Service Discovery</a><span>, in §9</span>
   <li><a href="#privacy-feature">Privacy Feature</a><span>, in §9</span>
   <li><a href="#private-address">Private address</a><span>, in §9</span>
   <li><a href="#procedure-timeouts">Procedure Timeouts</a><span>, in §9</span>
   <li><a href="#procedure-timeouts">procedure times out</a><span>, in §9</span>
   <li><a href="#profile-fundamentals">Profile Fundamentals</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-properties">properties</a><span>, in §5.4</span>
   <li><a href="#public-bluetooth-address">Public Bluetooth Address</a><span>, in §9</span>
   <li><a href="#public-device-address">Public Device Address</a><span>, in §9</span>
   <li><a href="#query-the-bluetooth-cache">query the Bluetooth cache</a><span>, in §5.1.2</span>
   <li><a href="#query-the-bluetooth-permission">query the "bluetooth" permission</a><span>, in §3.1</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-read">read</a><span>, in §5.4.1</span>
   <li><a href="#read-bd_addr-command">Read BD_ADDR Command</a><span>, in §9</span>
   <li><a href="#read-characteristic-descriptors">Read Characteristic Descriptors</a><span>, in §9</span>
   <li><a href="#read-long-characteristic-descriptors">Read Long Characteristic Descriptors</a><span>, in §9</span>
   <li><a href="#read-only-arraybuffer">read only ArrayBuffer</a><span>, in §9</span>
   <li>
    readValue()
    <ul>
     <li><a href="#dom-bluetoothremotegattcharacteristic-readvalue">method for BluetoothRemoteGATTCharacteristic</a><span>, in §5.4</span>
     <li><a href="#dom-bluetoothremotegattdescriptor-readvalue">method for BluetoothRemoteGATTDescriptor</a><span>, in §5.5</span>
    </ul>
   <li><a href="#rssi">Received Signal Strength</a><span>, in §9</span>
   <li><a href="#dom-bluetooth-referringdevice">referringDevice</a><span>, in §3</span>
   <li><a href="#dom-bluetooth-referringdevice-slot">[[referringDevice]]</a><span>, in §3</span>
   <li><a href="#relationship-discovery">Relationship Discovery</a><span>, in §9</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-reliablewrite">reliableWrite</a><span>, in §5.4.1</span>
   <li><a href="#represented">Represented</a><span>, in §5.1.2</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">[[representedCharacteristic]]</a><span>, in §5.4</span>
   <li><a href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot">[[representedDescriptor]]</a><span>, in §5.5</span>
   <li><a href="#dom-bluetoothdevice-representeddevice-slot">[[representedDevice]]</a><span>, in §4.2</span>
   <li><a href="#dom-bluetoothremotegattservice-representedservice-slot">[[representedService]]</a><span>, in §5.3</span>
   <li><a href="#request-bluetooth-devices">request Bluetooth devices</a><span>, in §3</span>
   <li><a href="#dom-bluetooth-requestdevice">requestDevice()</a><span>, in §3</span>
   <li><a href="#dom-bluetooth-requestdevice">requestDevice(options)</a><span>, in §3</span>
   <li><a href="#dictdef-requestdeviceoptions">RequestDeviceOptions</a><span>, in §3</span>
   <li><a href="#request-the-bluetooth-permission">request the "bluetooth" permission</a><span>, in §3.1</span>
   <li><a href="#resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</a><span>, in §9</span>
   <li><a href="#resolveuuidname">ResolveUUIDName</a><span>, in §6.1</span>
   <li><a href="#revoke-bluetooth-access">revoke Bluetooth access</a><span>, in §3.1</span>
   <li><a href="#rssi">RSSI</a><span>, in §9</span>
   <li>
    rssi
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-rssi">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-rssi">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
    </ul>
   <li><a href="#same-attribute">same attribute</a><span>, in §5.1.4</span>
   <li><a href="#same-bluetooth-device">same Bluetooth device</a><span>, in §4.1</span>
   <li><a href="#same-bluetooth-device">same device</a><span>, in §4.1</span>
   <li><a href="#scan-for-devices">scan for devices</a><span>, in §3</span>
   <li><a href="#searching-for-services">Searching for Services</a><span>, in §9</span>
   <li><a href="#service">Service</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-service">service</a><span>, in §5.4</span>
   <li><a href="#eventdef-bluetoothremotegattservice-serviceadded">serviceadded</a><span>, in §5.6.2</span>
   <li><a href="#service-changed">Service Changed</a><span>, in §9</span>
   <li><a href="#eventdef-bluetoothremotegattservice-servicechanged">servicechanged</a><span>, in §5.6.2</span>
   <li><a href="#service-data">Service Data</a><span>, in §9</span>
   <li>
    serviceData
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-servicedata">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-servicedata">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothlescanfilterinit-servicedata">dict-member for BluetoothLEScanFilterInit</a><span>, in §3</span>
    </ul>
   <li><a href="#service-definition">Service Definition</a><span>, in §9</span>
   <li><a href="#serviceeventhandlers">ServiceEventHandlers</a><span>, in §5.6.6</span>
   <li><a href="#service-interoperability-requirements">Service Interoperability Requirements</a><span>, in §9</span>
   <li><a href="#eventdef-bluetoothremotegattservice-serviceremoved">serviceremoved</a><span>, in §5.6.2</span>
   <li><a href="#dom-bluetoothlescanfilterinit-services">services</a><span>, in §3</span>
   <li><a href="#service-uuid-data-type">Service UUID Data Type</a><span>, in §9</span>
   <li><a href="#service-uuid-data-type">Service UUIDs</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-startnotifications">startNotifications()</a><span>, in §5.4</span>
   <li><a href="#static-address">Static Address</a><span>, in §9</span>
   <li><a href="#static-device-address">Static Device Address</a><span>, in §9</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-stopnotifications">stopNotifications()</a><span>, in §5.4</span>
   <li><a href="#supported-physical-transports">supported physical transports</a><span>, in §4.1</span>
   <li><a href="#the-128-bit-uuid-represented">the 128-bit UUID represented</a><span>, in §9</span>
   <li>
    txPower
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-txpower">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-txpower">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
    </ul>
   <li><a href="#tx-power-level">TX Power Level</a><span>, in §9</span>
   <li><a href="#dom-bluetoothdevice-unwatchadvertisements">unwatchAdvertisements()</a><span>, in §4.2</span>
   <li>
    uuid
    <ul>
     <li><a href="#dom-bluetoothremotegattcharacteristic-uuid">attribute for BluetoothRemoteGATTCharacteristic</a><span>, in §5.4</span>
     <li><a href="#dom-bluetoothremotegattdescriptor-uuid">attribute for BluetoothRemoteGATTDescriptor</a><span>, in §5.5</span>
     <li><a href="#dom-bluetoothremotegattservice-uuid">attribute for BluetoothRemoteGATTService</a><span>, in §5.3</span>
    </ul>
   <li>
    UUID
    <ul>
     <li><a href="#typedefdef-uuid">(typedef)</a><span>, in §6</span>
     <li><a href="#uuid">definition of</a><span>, in §9</span>
    </ul>
   <li><a href="#uuid-alias">UUID alias</a><span>, in §9</span>
   <li>
    uuids
    <ul>
     <li><a href="#dom-bluetoothadvertisingevent-uuids">attribute for BluetoothAdvertisingEvent</a><span>, in §4.2.1</span>
     <li><a href="#dom-bluetoothadvertisingeventinit-uuids">dict-member for BluetoothAdvertisingEventInit</a><span>, in §4.2.1</span>
    </ul>
   <li><a href="#valid-uuid">valid UUID</a><span>, in §6</span>
   <li>
    value
    <ul>
     <li><a href="#dom-bluetoothremotegattcharacteristic-value">attribute for BluetoothRemoteGATTCharacteristic</a><span>, in §5.4</span>
     <li><a href="#dom-bluetoothremotegattdescriptor-value">attribute for BluetoothRemoteGATTDescriptor</a><span>, in §5.5</span>
     <li><a href="#dom-valueevent-value">attribute for ValueEvent</a><span>, in §3.2</span>
     <li><a href="#dom-valueeventinit-value">dict-member for ValueEventInit</a><span>, in §3.2</span>
    </ul>
   <li><a href="#valueevent">ValueEvent</a><span>, in §3.2</span>
   <li><a href="#dictdef-valueeventinit">ValueEventInit</a><span>, in §3.2</span>
   <li><a href="#dom-valueevent-valueevent">ValueEvent(type)</a><span>, in §3.2</span>
   <li><a href="#dom-valueevent-valueevent">ValueEvent(type, initDict)</a><span>, in §3.2</span>
   <li><a href="#dom-bluetoothdevice-watchadvertisements">watchAdvertisements()</a><span>, in §4.2</span>
   <li><a href="#dom-bluetoothdevice-watchingadvertisements">watchingAdvertisements</a><span>, in §4.2</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-writableauxiliaries">writableAuxiliaries</a><span>, in §5.4.1</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-write">write</a><span>, in §5.4.1</span>
   <li><a href="#write-characteristic-descriptors">Write Characteristic Descriptors</a><span>, in §9</span>
   <li><a href="#write-characteristic-value">Write Characteristic Value</a><span>, in §9</span>
   <li><a href="#writecharacteristicvalue">WriteCharacteristicValue</a><span>, in §5.4</span>
   <li><a href="#write-long-characteristic-descriptors">Write Long Characteristic Descriptors</a><span>, in §9</span>
   <li>
    writeValue(value)
    <ul>
     <li><a href="#dom-bluetoothremotegattcharacteristic-writevalue">method for BluetoothRemoteGATTCharacteristic</a><span>, in §5.4</span>
     <li><a href="#dom-bluetoothremotegattdescriptor-writevalue">method for BluetoothRemoteGATTDescriptor</a><span>, in §5.5</span>
    </ul>
   <li><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse">writeValueWithoutResponse(value)</a><span>, in §5.4</span>
   <li><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse">writeValueWithResponse(value)</a><span>, in §5.4</span>
   <li><a href="#write-without-response">Write Without Response</a><span>, in §9</span>
   <li><a href="#dom-bluetoothcharacteristicproperties-writewithoutresponse">writeWithoutResponse</a><span>, in §5.4.1</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml#">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">1.1. Examples</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml#">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_control_point.xml#">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_control_point.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">1.1. Examples</a> <a href="#termref-for-">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml#">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">1.1. Examples</a> <a href="#termref-for-">(2)</a>
    <li><a href="#termref-for-">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list.xml#">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml#">https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml#">https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.cycling_power.xml#">https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.cycling_power.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml#">https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">1.1. Examples</a>
    <li><a href="#termref-for-">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-">
   <a href="https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile#">https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile#</a><b>Referenced in:</b>
   <ul>
    <li><a href="#termref-for-">4.1. Global Bluetooth device properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event">
   <a href="https://dom.spec.whatwg.org/#event">https://dom.spec.whatwg.org/#event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-event①">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-eventinit">
   <a href="https://dom.spec.whatwg.org/#dictdef-eventinit">https://dom.spec.whatwg.org/#dictdef-eventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-eventinit">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-dictdef-eventinit①">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">3. Device Discovery</a>
    <li><a href="#ref-for-eventtarget①">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-eventtarget②">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-eventtarget③">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-bubbles">
   <a href="https://dom.spec.whatwg.org/#dom-event-bubbles">https://dom.spec.whatwg.org/#dom-event-bubbles</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-bubbles">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-tree-child">
   <a href="https://dom.spec.whatwg.org/#concept-tree-child">https://dom.spec.whatwg.org/#concept-tree-child</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-tree-child">5.6.1. Bluetooth Tree</a> <a href="#ref-for-concept-tree-child①">(2)</a> <a href="#ref-for-concept-tree-child②">(3)</a> <a href="#ref-for-concept-tree-child③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-context-object">
   <a href="https://dom.spec.whatwg.org/#context-object">https://dom.spec.whatwg.org/#context-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-context-object">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-fire">
   <a href="https://dom.spec.whatwg.org/#concept-event-fire">https://dom.spec.whatwg.org/#concept-event-fire</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-fire">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-concept-event-fire①">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-concept-event-fire②">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-concept-event-fire③">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-concept-event-fire④">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-concept-event-fire⑤">5.6.5. Responding to Service Changes</a> <a href="#ref-for-concept-event-fire⑥">(2)</a> <a href="#ref-for-concept-event-fire⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-istrusted">
   <a href="https://dom.spec.whatwg.org/#dom-event-istrusted">https://dom.spec.whatwg.org/#dom-event-istrusted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-istrusted">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-tree-participate">
   <a href="https://dom.spec.whatwg.org/#concept-tree-participate">https://dom.spec.whatwg.org/#concept-tree-participate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-tree-participate">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-array-objects">
   <a href="https://tc39.github.io/ecma262/#sec-array-objects">https://tc39.github.io/ecma262/#sec-array-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-array-objects">3. Device Discovery</a>
    <li><a href="#ref-for-sec-array-objects①">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-array.prototype.map">
   <a href="https://tc39.github.io/ecma262/#sec-array.prototype.map">https://tc39.github.io/ecma262/#sec-array.prototype.map</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-array.prototype.map">3. Device Discovery</a> <a href="#ref-for-sec-array.prototype.map①">(2)</a>
    <li><a href="#ref-for-sec-array.prototype.map②">9. Terminology and Conventions</a> <a href="#ref-for-sec-array.prototype.map③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-arraybuffer-constructor">
   <a href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor">https://tc39.github.io/ecma262/#sec-arraybuffer-constructor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-arraybuffer-constructor">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-sec-arraybuffer-constructor①">(2)</a>
    <li><a href="#ref-for-sec-arraybuffer-constructor②">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-sec-arraybuffer-constructor③">(2)</a> <a href="#ref-for-sec-arraybuffer-constructor④">(3)</a>
    <li><a href="#ref-for-sec-arraybuffer-constructor⑤">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-sec-arraybuffer-constructor⑥">(2)</a> <a href="#ref-for-sec-arraybuffer-constructor⑦">(3)</a>
    <li><a href="#ref-for-sec-arraybuffer-constructor⑧">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-sec-arraybuffer-constructor⑨">9. Terminology and Conventions</a> <a href="#ref-for-sec-arraybuffer-constructor①⓪">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-canonicalnumericindexstring">
   <a href="https://tc39.github.io/ecma262/#sec-canonicalnumericindexstring">https://tc39.github.io/ecma262/#sec-canonicalnumericindexstring</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-canonicalnumericindexstring">3. Device Discovery</a> <a href="#ref-for-sec-canonicalnumericindexstring①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-createdataproperty">
   <a href="https://tc39.github.io/ecma262/#sec-createdataproperty">https://tc39.github.io/ecma262/#sec-createdataproperty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-createdataproperty">3. Device Discovery</a> <a href="#ref-for-sec-createdataproperty①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-dataview-constructor">
   <a href="https://tc39.github.io/ecma262/#sec-dataview-constructor">https://tc39.github.io/ecma262/#sec-dataview-constructor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-dataview-constructor">1.1. Examples</a>
    <li><a href="#ref-for-sec-dataview-constructor①">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-sec-dataview-constructor②">(2)</a> <a href="#ref-for-sec-dataview-constructor③">(3)</a> <a href="#ref-for-sec-dataview-constructor④">(4)</a>
    <li><a href="#ref-for-sec-dataview-constructor⑤">4.2.1.1. BluetoothManufacturerDataMap</a>
    <li><a href="#ref-for-sec-dataview-constructor⑥">4.2.1.2. BluetoothServiceDataMap</a>
    <li><a href="#ref-for-sec-dataview-constructor⑦">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-sec-dataview-constructor⑧">(2)</a> <a href="#ref-for-sec-dataview-constructor⑨">(3)</a> <a href="#ref-for-sec-dataview-constructor①⓪">(4)</a>
    <li><a href="#ref-for-sec-dataview-constructor①①">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-sec-dataview-constructor①②">(2)</a> <a href="#ref-for-sec-dataview-constructor①③">(3)</a> <a href="#ref-for-sec-dataview-constructor①④">(4)</a>
    <li><a href="#ref-for-sec-dataview-constructor①⑤">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-sec-dataview-constructor①⑥">9. Terminology and Conventions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-isinteger">
   <a href="https://tc39.github.io/ecma262/#sec-isinteger">https://tc39.github.io/ecma262/#sec-isinteger</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-isinteger">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-promise-objects">
   <a href="https://tc39.github.io/ecma262/#sec-promise-objects">https://tc39.github.io/ecma262/#sec-promise-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-promise-objects">2.5. Exposing Bluetooth availability</a>
    <li><a href="#ref-for-sec-promise-objects①">3. Device Discovery</a> <a href="#ref-for-sec-promise-objects②">(2)</a>
    <li><a href="#ref-for-sec-promise-objects③">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-sec-promise-objects④">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-sec-promise-objects⑤">(2)</a> <a href="#ref-for-sec-promise-objects⑥">(3)</a> <a href="#ref-for-sec-promise-objects⑦">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-set-objects">
   <a href="https://tc39.github.io/ecma262/#sec-set-objects">https://tc39.github.io/ecma262/#sec-set-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-set-objects">3. Device Discovery</a>
    <li><a href="#ref-for-sec-set-objects①">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-native-error-types-used-in-this-standard-typeerror">
   <a href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror">https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror">3. Device Discovery</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①">(2)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror②">(3)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror③">(4)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror④">(5)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror⑤">(6)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror⑥">(7)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror⑦">(8)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror⑧">(9)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror⑨">(10)</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①⓪">(11)</a>
    <li><a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①①">3.1. Permission API Integration</a>
    <li><a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①②">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①③">(2)</a>
    <li><a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①④">6.1. Standardized UUIDs</a> <a href="#ref-for-sec-native-error-types-used-in-this-standard-typeerror①⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-typedarray-constructors">
   <a href="https://tc39.github.io/ecma262/#sec-typedarray-constructors">https://tc39.github.io/ecma262/#sec-typedarray-constructors</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-typedarray-constructors">9. Terminology and Conventions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">
   <a href="https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">3. Device Discovery</a> <a href="#ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys①">(2)</a> <a href="#ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys②">(3)</a> <a href="#ref-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-realm">
   <a href="https://tc39.github.io/ecma262/#current-realm">https://tc39.github.io/ecma262/#current-realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-realm">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-object-internal-methods-and-internal-slots">
   <a href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots">https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots">3. Device Discovery</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots①">(2)</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots②">3.1. Permission API Integration</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots③">4.2. BluetoothDevice</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots④">(2)</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots⑤">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots⑥">(2)</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots⑦">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots⑧">(2)</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots⑨">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots①⓪">(2)</a>
    <li><a href="#ref-for-sec-object-internal-methods-and-internal-slots①①">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-sec-object-internal-methods-and-internal-slots①②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-code-realms">
   <a href="https://tc39.github.io/ecma262/#sec-code-realms">https://tc39.github.io/ecma262/#sec-code-realms</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-code-realms">3. Device Discovery</a>
    <li><a href="#ref-for-sec-code-realms①">3.1. Permission API Integration</a>
    <li><a href="#ref-for-sec-code-realms②">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-sec-code-realms③">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-sec-code-realms④">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-sec-code-realms⑤">5.6.3. Responding to Disconnection</a> <a href="#ref-for-sec-code-realms⑥">(2)</a> <a href="#ref-for-sec-code-realms⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-utf-8-decode-without-bom">
   <a href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom">https://encoding.spec.whatwg.org/#utf-8-decode-without-bom</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-utf-8-decode-without-bom">4.1. Global Bluetooth device properties</a>
    <li><a href="#ref-for-utf-8-decode-without-bom①">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-utf-8-encode">
   <a href="https://encoding.spec.whatwg.org/#utf-8-encode">https://encoding.spec.whatwg.org/#utf-8-encode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-utf-8-encode">3. Device Discovery</a> <a href="#ref-for-utf-8-encode①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-fingerprinting-surface">
   <a href="https://w3c.github.io/fingerprinting-guidance/#dfn-fingerprinting-surface">https://w3c.github.io/fingerprinting-guidance/#dfn-fingerprinting-surface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-fingerprinting-surface">2.5. Exposing Bluetooth availability</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">3. Device Discovery</a>
    <li><a href="#ref-for-eventhandler①">5.6.6. IDL event handlers</a> <a href="#ref-for-eventhandler②">(2)</a> <a href="#ref-for-eventhandler③">(3)</a> <a href="#ref-for-eventhandler④">(4)</a> <a href="#ref-for-eventhandler⑤">(5)</a> <a href="#ref-for-eventhandler⑥">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigator">
   <a href="https://html.spec.whatwg.org/multipage/system-state.html#navigator">https://html.spec.whatwg.org/multipage/system-state.html#navigator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigator">8. Extensions to the Navigator Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-browsing-context">3. Device Discovery</a>
    <li><a href="#ref-for-browsing-context①">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-settings-object">3. Device Discovery</a>
    <li><a href="#ref-for-current-settings-object①">3.1. Permission API Integration</a> <a href="#ref-for-current-settings-object②">(2)</a>
    <li><a href="#ref-for-current-settings-object③">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-environment-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-environment-settings-object">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-idl-attributes">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-idl-attributes">5.6.6. IDL event handlers</a> <a href="#ref-for-event-handler-idl-attributes①">(2)</a> <a href="#ref-for-event-handler-idl-attributes②">(3)</a> <a href="#ref-for-event-handler-idl-attributes③">(4)</a> <a href="#ref-for-event-handler-idl-attributes④">(5)</a> <a href="#ref-for-event-handler-idl-attributes⑤">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-global">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">3. Device Discovery</a> <a href="#ref-for-in-parallel①">(2)</a>
    <li><a href="#ref-for-in-parallel②">3.2. Overall Bluetooth availability</a> <a href="#ref-for-in-parallel③">(2)</a>
    <li><a href="#ref-for-in-parallel④">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-in-parallel⑤">5.1.2. The Bluetooth cache</a> <a href="#ref-for-in-parallel⑥">(2)</a>
    <li><a href="#ref-for-in-parallel⑦">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-in-parallel⑧">(2)</a>
    <li><a href="#ref-for-in-parallel⑨">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-in-parallel①⓪">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-in-parallel①①">(2)</a> <a href="#ref-for-in-parallel①②">(3)</a> <a href="#ref-for-in-parallel①③">(4)</a>
    <li><a href="#ref-for-in-parallel①④">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-in-parallel①⑤">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-in-parallel①⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-initialise-the-document-object">
   <a href="https://html.spec.whatwg.org/#initialise-the-document-object">https://html.spec.whatwg.org/#initialise-the-document-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-initialise-the-document-object">3. Device Discovery</a> <a href="#ref-for-initialise-the-document-object①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigate">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate">https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigate">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-perform-a-microtask-checkpoint">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint">https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-perform-a-microtask-checkpoint">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-queue-a-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-task">3.2. Overall Bluetooth availability</a> <a href="#ref-for-queue-a-task①">(2)</a> <a href="#ref-for-queue-a-task②">(3)</a> <a href="#ref-for-queue-a-task③">(4)</a>
    <li><a href="#ref-for-queue-a-task④">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-queue-a-task⑤">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-queue-a-task⑥">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-queue-a-task⑦">(2)</a> <a href="#ref-for-queue-a-task⑧">(3)</a>
    <li><a href="#ref-for-queue-a-task⑨">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-queue-a-task①⓪">(2)</a> <a href="#ref-for-queue-a-task①①">(3)</a>
    <li><a href="#ref-for-queue-a-task①②">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-queue-a-task①③">(2)</a>
    <li><a href="#ref-for-queue-a-task①④">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-queue-a-task①⑤">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-queue-a-task①⑥">5.6.5. Responding to Service Changes</a> <a href="#ref-for-queue-a-task①⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-relevant-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-relevant-global">3.1. Permission API Integration</a>
    <li><a href="#ref-for-concept-relevant-global①">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relevant-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relevant-settings-object">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-relevant-settings-object①">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-relevant-settings-object②">5.6.1. Bluetooth Tree</a>
    <li><a href="#ref-for-relevant-settings-object③">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-relevant-settings-object④">5.6.5. Responding to Service Changes</a> <a href="#ref-for-relevant-settings-object⑤">(2)</a> <a href="#ref-for-relevant-settings-object⑥">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-event-loop">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-responsible-event-loop①">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-responsible-event-loop②">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-responsible-event-loop③">5.6.5. Responding to Service Changes</a> <a href="#ref-for-responsible-event-loop④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-triggered-by-user-activation">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation">https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-triggered-by-user-activation">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissionstate-denied">
   <a href="https://w3c.github.io/permissions/#dom-permissionstate-denied">https://w3c.github.io/permissions/#dom-permissionstate-denied</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstate-denied">3. Device Discovery</a> <a href="#ref-for-dom-permissionstate-denied①">(2)</a> <a href="#ref-for-dom-permissionstate-denied②">(3)</a>
    <li><a href="#ref-for-dom-permissionstate-denied③">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-permissiondescriptor">
   <a href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor">https://w3c.github.io/permissions/#dictdef-permissiondescriptor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-permissiondescriptor">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permissionstatus">
   <a href="https://w3c.github.io/permissions/#permissionstatus">https://w3c.github.io/permissions/#permissionstatus</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permissionstatus">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-allowed-in-non-secure-contexts">
   <a href="https://w3c.github.io/permissions/#allowed-in-non-secure-contexts">https://w3c.github.io/permissions/#allowed-in-non-secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-allowed-in-non-secure-contexts">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extra-permission-data">
   <a href="https://w3c.github.io/permissions/#extra-permission-data">https://w3c.github.io/permissions/#extra-permission-data</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data">3. Device Discovery</a>
    <li><a href="#ref-for-extra-permission-data①">3.1. Permission API Integration</a> <a href="#ref-for-extra-permission-data②">(2)</a> <a href="#ref-for-extra-permission-data③">(3)</a>
    <li><a href="#ref-for-extra-permission-data④">4.2. BluetoothDevice</a> <a href="#ref-for-extra-permission-data⑤">(2)</a>
    <li><a href="#ref-for-extra-permission-data⑥">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extra-permission-data-constraints">
   <a href="https://w3c.github.io/permissions/#extra-permission-data-constraints">https://w3c.github.io/permissions/#extra-permission-data-constraints</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data-constraints">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extra-permission-data-type">
   <a href="https://w3c.github.io/permissions/#extra-permission-data-type">https://w3c.github.io/permissions/#extra-permission-data-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data-type">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissiondescriptor-name">
   <a href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name">https://w3c.github.io/permissions/#dom-permissiondescriptor-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissiondescriptor-name">3.1. Permission API Integration</a> <a href="#ref-for-dom-permissiondescriptor-name①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-descriptor-type">
   <a href="https://w3c.github.io/permissions/#permission-descriptor-type">https://w3c.github.io/permissions/#permission-descriptor-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-descriptor-type">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-query-algorithm">
   <a href="https://w3c.github.io/permissions/#permission-query-algorithm">https://w3c.github.io/permissions/#permission-query-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-query-algorithm">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-result-type">
   <a href="https://w3c.github.io/permissions/#permission-result-type">https://w3c.github.io/permissions/#permission-result-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-result-type">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-revocation-algorithm">
   <a href="https://w3c.github.io/permissions/#permission-revocation-algorithm">https://w3c.github.io/permissions/#permission-revocation-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-revocation-algorithm">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-state">
   <a href="https://w3c.github.io/permissions/#permission-state">https://w3c.github.io/permissions/#permission-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-state">3. Device Discovery</a>
    <li><a href="#ref-for-permission-state①">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-powerful-feature">
   <a href="https://w3c.github.io/permissions/#powerful-feature">https://w3c.github.io/permissions/#powerful-feature</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-powerful-feature">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-prompt-the-user-to-choose">
   <a href="https://w3c.github.io/permissions/#prompt-the-user-to-choose">https://w3c.github.io/permissions/#prompt-the-user-to-choose</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-prompt-the-user-to-choose">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissions-query">
   <a href="https://w3c.github.io/permissions/#dom-permissions-query">https://w3c.github.io/permissions/#dom-permissions-query</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissions-query">3.1. Permission API Integration</a> <a href="#ref-for-dom-permissions-query①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissionstatus-state">
   <a href="https://w3c.github.io/permissions/#dom-permissionstatus-state">https://w3c.github.io/permissions/#dom-permissionstatus-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstatus-state">3.1. Permission API Integration</a> <a href="#ref-for-dom-permissionstatus-state①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-request-algorithm">
   <a href="https://wicg.github.io/permissions-request/#permission-request-algorithm">https://wicg.github.io/permissions-request/#permission-request-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-request-algorithm">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissions-request">
   <a href="https://wicg.github.io/permissions-request/#dom-permissions-request">https://wicg.github.io/permissions-request/#dom-permissions-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissions-request">3.1. Permission API Integration</a> <a href="#ref-for-dom-permissions-request①">(2)</a> <a href="#ref-for-dom-permissions-request②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-new-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise">https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-new-promise">3. Device Discovery</a>
    <li><a href="#ref-for-a-new-promise①">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-a-new-promise②">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-a-new-promise③">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-a-new-promise④">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-a-new-promise⑤">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-a-new-promise⑥">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-a-new-promise⑦">(2)</a> <a href="#ref-for-a-new-promise⑧">(3)</a> <a href="#ref-for-a-new-promise⑨">(4)</a> <a href="#ref-for-a-new-promise①⓪">(5)</a>
    <li><a href="#ref-for-a-new-promise①①">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-a-new-promise①②">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-a-new-promise①③">(2)</a> <a href="#ref-for-a-new-promise①④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-promise-rejected-with">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with">https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-promise-rejected-with">5.1.3. Navigating the Bluetooth Hierarchy</a> <a href="#ref-for-a-promise-rejected-with①">(2)</a> <a href="#ref-for-a-promise-rejected-with②">(3)</a> <a href="#ref-for-a-promise-rejected-with③">(4)</a>
    <li><a href="#ref-for-a-promise-rejected-with④">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-a-promise-rejected-with⑤">(2)</a>
    <li><a href="#ref-for-a-promise-rejected-with⑥">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-a-promise-rejected-with⑦">(2)</a> <a href="#ref-for-a-promise-rejected-with⑧">(3)</a> <a href="#ref-for-a-promise-rejected-with⑨">(4)</a> <a href="#ref-for-a-promise-rejected-with①⓪">(5)</a> <a href="#ref-for-a-promise-rejected-with①①">(6)</a> <a href="#ref-for-a-promise-rejected-with①②">(7)</a> <a href="#ref-for-a-promise-rejected-with①③">(8)</a> <a href="#ref-for-a-promise-rejected-with①④">(9)</a>
    <li><a href="#ref-for-a-promise-rejected-with①⑤">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-a-promise-rejected-with①⑥">(2)</a> <a href="#ref-for-a-promise-rejected-with①⑦">(3)</a> <a href="#ref-for-a-promise-rejected-with①⑧">(4)</a> <a href="#ref-for-a-promise-rejected-with①⑨">(5)</a> <a href="#ref-for-a-promise-rejected-with②⓪">(6)</a> <a href="#ref-for-a-promise-rejected-with②①">(7)</a>
    <li><a href="#ref-for-a-promise-rejected-with②②">6. UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-reject-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reject-promise">3. Device Discovery</a> <a href="#ref-for-reject-promise①">(2)</a> <a href="#ref-for-reject-promise②">(3)</a>
    <li><a href="#ref-for-reject-promise③">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-reject-promise④">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-reject-promise⑤">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-reject-promise⑥">(2)</a> <a href="#ref-for-reject-promise⑦">(3)</a> <a href="#ref-for-reject-promise⑧">(4)</a> <a href="#ref-for-reject-promise⑨">(5)</a> <a href="#ref-for-reject-promise①⓪">(6)</a>
    <li><a href="#ref-for-reject-promise①①">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-reject-promise①②">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-reject-promise①③">(2)</a> <a href="#ref-for-reject-promise①④">(3)</a> <a href="#ref-for-reject-promise①⑤">(4)</a> <a href="#ref-for-reject-promise①⑥">(5)</a> <a href="#ref-for-reject-promise①⑦">(6)</a> <a href="#ref-for-reject-promise①⑧">(7)</a> <a href="#ref-for-reject-promise①⑨">(8)</a> <a href="#ref-for-reject-promise②⓪">(9)</a> <a href="#ref-for-reject-promise②①">(10)</a> <a href="#ref-for-reject-promise②②">(11)</a> <a href="#ref-for-reject-promise②③">(12)</a> <a href="#ref-for-reject-promise②④">(13)</a>
    <li><a href="#ref-for-reject-promise②⑤">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-reject-promise②⑥">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-reject-promise②⑦">(2)</a> <a href="#ref-for-reject-promise②⑧">(3)</a> <a href="#ref-for-reject-promise②⑨">(4)</a> <a href="#ref-for-reject-promise③⓪">(5)</a> <a href="#ref-for-reject-promise③①">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-upon-fulfillment">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#upon-fulfillment">https://www.w3.org/2001/tag/doc/promises-guide/#upon-fulfillment</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-upon-fulfillment">5.1.3. Navigating the Bluetooth Hierarchy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-waiting-for-all">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#waiting-for-all">https://www.w3.org/2001/tag/doc/promises-guide/#waiting-for-all</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-waiting-for-all">5.1.2. The Bluetooth cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-non-secure-contexts">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts">https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-non-secure-contexts">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-secure-contexts">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts">https://w3c.github.io/webappsec-secure-contexts/#secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-secure-contexts">2.1. Device access is powerful</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-aborterror">
   <a href="https://heycam.github.io/webidl/#aborterror">https://heycam.github.io/webidl/#aborterror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-aborterror">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-aborterror①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-BufferSource">
   <a href="https://heycam.github.io/webidl/#BufferSource">https://heycam.github.io/webidl/#BufferSource</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-BufferSource">3. Device Discovery</a> <a href="#ref-for-BufferSource①">(2)</a>
    <li><a href="#ref-for-BufferSource②">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-BufferSource③">(2)</a>
    <li><a href="#ref-for-BufferSource④">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-BufferSource⑤">(2)</a> <a href="#ref-for-BufferSource⑥">(3)</a>
    <li><a href="#ref-for-BufferSource⑦">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMException">
   <a href="https://heycam.github.io/webidl/#idl-DOMException">https://heycam.github.io/webidl/#idl-DOMException</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMException">3.1. Permission API Integration</a> <a href="#ref-for-idl-DOMException①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">3. Device Discovery</a> <a href="#ref-for-idl-DOMString①">(2)</a>
    <li><a href="#ref-for-idl-DOMString②">3.1. Permission API Integration</a> <a href="#ref-for-idl-DOMString③">(2)</a> <a href="#ref-for-idl-DOMString④">(3)</a>
    <li><a href="#ref-for-idl-DOMString⑤">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-idl-DOMString⑥">4.2. BluetoothDevice</a> <a href="#ref-for-idl-DOMString⑦">(2)</a>
    <li><a href="#ref-for-idl-DOMString⑧">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-idl-DOMString⑨">(2)</a> <a href="#ref-for-idl-DOMString①⓪">(3)</a> <a href="#ref-for-idl-DOMString①①">(4)</a>
    <li><a href="#ref-for-idl-DOMString①②">6. UUIDs</a>
    <li><a href="#ref-for-idl-DOMString①③">6.1. Standardized UUIDs</a> <a href="#ref-for-idl-DOMString①④">(2)</a> <a href="#ref-for-idl-DOMString①⑤">(3)</a> <a href="#ref-for-idl-DOMString①⑥">(4)</a> <a href="#ref-for-idl-DOMString①⑦">(5)</a> <a href="#ref-for-idl-DOMString①⑧">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-EnforceRange">
   <a href="https://heycam.github.io/webidl/#EnforceRange">https://heycam.github.io/webidl/#EnforceRange</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-EnforceRange">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">3. Device Discovery</a>
    <li><a href="#ref-for-Exposed①">3.1. Permission API Integration</a>
    <li><a href="#ref-for-Exposed②">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-Exposed③">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-Exposed④">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-Exposed⑤">(2)</a> <a href="#ref-for-Exposed⑥">(3)</a>
    <li><a href="#ref-for-Exposed⑦">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-Exposed⑧">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-Exposed⑨">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-Exposed①⓪">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-Exposed①①">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-Exposed①②">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-frozen-array">
   <a href="https://heycam.github.io/webidl/#idl-frozen-array">https://heycam.github.io/webidl/#idl-frozen-array</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-frozen-array">3.1. Permission API Integration</a> <a href="#ref-for-idl-frozen-array①">(2)</a> <a href="#ref-for-idl-frozen-array②">(3)</a>
    <li><a href="#ref-for-idl-frozen-array③">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-idl-frozen-array④">(2)</a>
    <li><a href="#ref-for-idl-frozen-array⑤">9. Terminology and Conventions</a> <a href="#ref-for-idl-frozen-array⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidmodificationerror">
   <a href="https://heycam.github.io/webidl/#invalidmodificationerror">https://heycam.github.io/webidl/#invalidmodificationerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidmodificationerror">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-invalidmodificationerror①">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-invalidmodificationerror②">5.7. Error handling</a> <a href="#ref-for-invalidmodificationerror③">(2)</a> <a href="#ref-for-invalidmodificationerror④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidstateerror">
   <a href="https://heycam.github.io/webidl/#invalidstateerror">https://heycam.github.io/webidl/#invalidstateerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidstateerror">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-invalidstateerror①">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-invalidstateerror②">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-invalidstateerror③">(2)</a> <a href="#ref-for-invalidstateerror④">(3)</a> <a href="#ref-for-invalidstateerror⑤">(4)</a>
    <li><a href="#ref-for-invalidstateerror⑥">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-invalidstateerror⑦">(2)</a>
    <li><a href="#ref-for-invalidstateerror⑧">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-networkerror">
   <a href="https://heycam.github.io/webidl/#networkerror">https://heycam.github.io/webidl/#networkerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-networkerror">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-networkerror①">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-networkerror②">(2)</a> <a href="#ref-for-networkerror③">(3)</a> <a href="#ref-for-networkerror④">(4)</a> <a href="#ref-for-networkerror⑤">(5)</a> <a href="#ref-for-networkerror⑥">(6)</a> <a href="#ref-for-networkerror⑦">(7)</a>
    <li><a href="#ref-for-networkerror⑧">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-networkerror⑨">(2)</a> <a href="#ref-for-networkerror①⓪">(3)</a> <a href="#ref-for-networkerror①①">(4)</a> <a href="#ref-for-networkerror①②">(5)</a> <a href="#ref-for-networkerror①③">(6)</a> <a href="#ref-for-networkerror①④">(7)</a> <a href="#ref-for-networkerror①⑤">(8)</a> <a href="#ref-for-networkerror①⑥">(9)</a> <a href="#ref-for-networkerror①⑦">(10)</a> <a href="#ref-for-networkerror①⑧">(11)</a>
    <li><a href="#ref-for-networkerror①⑨">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-networkerror②⓪">(2)</a> <a href="#ref-for-networkerror②①">(3)</a> <a href="#ref-for-networkerror②②">(4)</a> <a href="#ref-for-networkerror②③">(5)</a> <a href="#ref-for-networkerror②④">(6)</a> <a href="#ref-for-networkerror②⑤">(7)</a> <a href="#ref-for-networkerror②⑥">(8)</a>
    <li><a href="#ref-for-networkerror②⑦">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notfounderror">
   <a href="https://heycam.github.io/webidl/#notfounderror">https://heycam.github.io/webidl/#notfounderror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notfounderror">3. Device Discovery</a>
    <li><a href="#ref-for-notfounderror①">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-notfounderror②">5.1.3. Navigating the Bluetooth Hierarchy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notsupportederror">
   <a href="https://heycam.github.io/webidl/#notsupportederror">https://heycam.github.io/webidl/#notsupportederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notsupportederror">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-notsupportederror①">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-notsupportederror②">(2)</a> <a href="#ref-for-notsupportederror③">(3)</a>
    <li><a href="#ref-for-notsupportederror④">5.7. Error handling</a> <a href="#ref-for-notsupportederror⑤">(2)</a> <a href="#ref-for-notsupportederror⑥">(3)</a> <a href="#ref-for-notsupportederror⑦">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SameObject">
   <a href="https://heycam.github.io/webidl/#SameObject">https://heycam.github.io/webidl/#SameObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SameObject">3. Device Discovery</a>
    <li><a href="#ref-for-SameObject①">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-SameObject②">(2)</a> <a href="#ref-for-SameObject③">(3)</a>
    <li><a href="#ref-for-SameObject④">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-SameObject⑤">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-SameObject⑥">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-SameObject⑦">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-SameObject⑧">8. Extensions to the Navigator Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">3. Device Discovery</a>
    <li><a href="#ref-for-SecureContext①">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-SecureContext②">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-SecureContext③">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-SecureContext④">(2)</a> <a href="#ref-for-SecureContext⑤">(3)</a>
    <li><a href="#ref-for-SecureContext⑥">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-SecureContext⑦">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-SecureContext⑧">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-SecureContext⑨">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-SecureContext①⓪">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-SecureContext①①">5.6.6. IDL event handlers</a> <a href="#ref-for-SecureContext①②">(2)</a> <a href="#ref-for-SecureContext①③">(3)</a>
    <li><a href="#ref-for-SecureContext①④">8. Extensions to the Navigator Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-securityerror">
   <a href="https://heycam.github.io/webidl/#securityerror">https://heycam.github.io/webidl/#securityerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-securityerror">3. Device Discovery</a> <a href="#ref-for-securityerror①">(2)</a> <a href="#ref-for-securityerror②">(3)</a>
    <li><a href="#ref-for-securityerror③">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-securityerror④">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-securityerror⑤">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-securityerror⑥">(2)</a>
    <li><a href="#ref-for-securityerror⑦">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-securityerror⑧">(2)</a> <a href="#ref-for-securityerror⑨">(3)</a>
    <li><a href="#ref-for-securityerror①⓪">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-securityerror①①">(2)</a>
    <li><a href="#ref-for-securityerror①②">5.7. Error handling</a> <a href="#ref-for-securityerror①③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-unknownerror">
   <a href="https://heycam.github.io/webidl/#unknownerror">https://heycam.github.io/webidl/#unknownerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-unknownerror">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-get-buffer-source-copy">
   <a href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy">https://heycam.github.io/webidl/#dfn-get-buffer-source-copy</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-get-buffer-source-copy">3. Device Discovery</a> <a href="#ref-for-dfn-get-buffer-source-copy①">(2)</a> <a href="#ref-for-dfn-get-buffer-source-copy②">(3)</a> <a href="#ref-for-dfn-get-buffer-source-copy③">(4)</a>
    <li><a href="#ref-for-dfn-get-buffer-source-copy④">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-dfn-get-buffer-source-copy⑤">(2)</a>
    <li><a href="#ref-for-dfn-get-buffer-source-copy⑥">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-dfn-get-buffer-source-copy⑦">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">3. Device Discovery</a> <a href="#ref-for-idl-boolean①">(2)</a>
    <li><a href="#ref-for-idl-boolean②">3.1. Permission API Integration</a> <a href="#ref-for-idl-boolean③">(2)</a>
    <li><a href="#ref-for-idl-boolean④">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-idl-boolean⑤">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-idl-boolean⑥">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-idl-boolean⑦">5.4.1. BluetoothCharacteristicProperties</a> <a href="#ref-for-idl-boolean⑧">(2)</a> <a href="#ref-for-idl-boolean⑨">(3)</a> <a href="#ref-for-idl-boolean①⓪">(4)</a> <a href="#ref-for-idl-boolean①①">(5)</a> <a href="#ref-for-idl-boolean①②">(6)</a> <a href="#ref-for-idl-boolean①③">(7)</a> <a href="#ref-for-idl-boolean①④">(8)</a> <a href="#ref-for-idl-boolean①⑤">(9)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-byte">
   <a href="https://heycam.github.io/webidl/#idl-byte">https://heycam.github.io/webidl/#idl-byte</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-byte">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-idl-byte①">(2)</a> <a href="#ref-for-idl-byte②">(3)</a> <a href="#ref-for-idl-byte③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-convert-idl-to-ecmascript-value">
   <a href="https://heycam.github.io/webidl/#dfn-convert-idl-to-ecmascript-value">https://heycam.github.io/webidl/#dfn-convert-idl-to-ecmascript-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-convert-idl-to-ecmascript-value">3. Device Discovery</a> <a href="#ref-for-dfn-convert-idl-to-ecmascript-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-convert-ecmascript-to-idl-value">
   <a href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value">3. Device Discovery</a> <a href="#ref-for-dfn-convert-ecmascript-to-idl-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-maplike">
   <a href="https://heycam.github.io/webidl/#dfn-maplike">https://heycam.github.io/webidl/#dfn-maplike</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-maplike">4.2.1.1. BluetoothManufacturerDataMap</a>
    <li><a href="#ref-for-dfn-maplike①">4.2.1.2. BluetoothServiceDataMap</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-object">
   <a href="https://heycam.github.io/webidl/#idl-object">https://heycam.github.io/webidl/#idl-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-object">3. Device Discovery</a> <a href="#ref-for-idl-object①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-unsigned-long">
   <a href="https://heycam.github.io/webidl/#idl-unsigned-long">https://heycam.github.io/webidl/#idl-unsigned-long</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-unsigned-long">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-idl-unsigned-long①">6.1. Standardized UUIDs</a> <a href="#ref-for-idl-unsigned-long②">(2)</a> <a href="#ref-for-idl-unsigned-long③">(3)</a> <a href="#ref-for-idl-unsigned-long④">(4)</a> <a href="#ref-for-idl-unsigned-long⑤">(5)</a> <a href="#ref-for-idl-unsigned-long⑥">(6)</a> <a href="#ref-for-idl-unsigned-long⑦">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-unsigned-short">
   <a href="https://heycam.github.io/webidl/#idl-unsigned-short">https://heycam.github.io/webidl/#idl-unsigned-short</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-unsigned-short">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-idl-unsigned-short①">(2)</a> <a href="#ref-for-idl-unsigned-short②">(3)</a> <a href="#ref-for-idl-unsigned-short③">(4)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[BLUETOOTH-ASSIGNED]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-" style="color:initial">org.bluetooth.characteristic.body_sensor_location</span>
     <li><span class="dfn-paneled" id="term-for-①" style="color:initial">org.bluetooth.characteristic.gap.appearance</span>
     <li><span class="dfn-paneled" id="term-for-②" style="color:initial">org.bluetooth.characteristic.heart_rate_control_point</span>
     <li><span class="dfn-paneled" id="term-for-③" style="color:initial">org.bluetooth.characteristic.heart_rate_measurement</span>
     <li><span class="dfn-paneled" id="term-for-④" style="color:initial">org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list</span>
     <li><span class="dfn-paneled" id="term-for-⑤" style="color:initial">org.bluetooth.descriptor.gatt.characteristic_presentation_format</span>
     <li><span class="dfn-paneled" id="term-for-⑥" style="color:initial">org.bluetooth.descriptor.gatt.client_characteristic_configuration</span>
     <li><span class="dfn-paneled" id="term-for-⑦" style="color:initial">org.bluetooth.service.cycling_power</span>
     <li><span class="dfn-paneled" id="term-for-⑧" style="color:initial">org.bluetooth.service.heart_rate</span>
     <li><span class="dfn-paneled" id="term-for-⑨" style="color:initial">shortened local name</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-event" style="color:initial">Event</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-eventinit" style="color:initial">EventInit</span>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-bubbles" style="color:initial">bubbles</span>
     <li><span class="dfn-paneled" id="term-for-concept-tree-child" style="color:initial">children</span>
     <li><span class="dfn-paneled" id="term-for-context-object" style="color:initial">context object</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-fire" style="color:initial">fire an event</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-istrusted" style="color:initial">isTrusted</span>
     <li><span class="dfn-paneled" id="term-for-concept-tree-participate" style="color:initial">participate in a tree</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ECMAScript]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-sec-array-objects" style="color:initial">Array</span>
     <li><span class="dfn-paneled" id="term-for-sec-array.prototype.map" style="color:initial">Array.prototype.map</span>
     <li><span class="dfn-paneled" id="term-for-sec-arraybuffer-constructor" style="color:initial">ArrayBuffer</span>
     <li><span class="dfn-paneled" id="term-for-sec-canonicalnumericindexstring" style="color:initial">CanonicalNumericIndexString</span>
     <li><span class="dfn-paneled" id="term-for-sec-createdataproperty" style="color:initial">CreateDataProperty</span>
     <li><span class="dfn-paneled" id="term-for-sec-dataview-constructor" style="color:initial">DataView</span>
     <li><span class="dfn-paneled" id="term-for-sec-isinteger" style="color:initial">IsInteger</span>
     <li><span class="dfn-paneled" id="term-for-sec-promise-objects" style="color:initial">Promise</span>
     <li><span class="dfn-paneled" id="term-for-sec-set-objects" style="color:initial">Set</span>
     <li><span class="dfn-paneled" id="term-for-sec-native-error-types-used-in-this-standard-typeerror" style="color:initial">TypeError</span>
     <li><span class="dfn-paneled" id="term-for-sec-typedarray-constructors" style="color:initial">TypedArray</span>
     <li><span class="dfn-paneled" id="term-for-sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys" style="color:initial">[[OwnPropertyKeys]]</span>
     <li><span class="dfn-paneled" id="term-for-current-realm" style="color:initial">current realm</span>
     <li><span class="dfn-paneled" id="term-for-sec-object-internal-methods-and-internal-slots" style="color:initial">internal slot</span>
     <li><span class="dfn-paneled" id="term-for-sec-code-realms" style="color:initial">realm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ENCODING]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-utf-8-decode-without-bom" style="color:initial">utf-8 decode without bom</span>
     <li><span class="dfn-paneled" id="term-for-utf-8-encode" style="color:initial">utf-8 encode</span>
    </ul>
   <li>
    <a data-link-type="biblio">[fingerprinting-guidance]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-fingerprinting-surface" style="color:initial">fingerprinting surface</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-navigator" style="color:initial">Navigator</span>
     <li><span class="dfn-paneled" id="term-for-browsing-context" style="color:initial">browsing context</span>
     <li><span class="dfn-paneled" id="term-for-current-settings-object" style="color:initial">current settings object</span>
     <li><span class="dfn-paneled" id="term-for-environment-settings-object" style="color:initial">environment settings object</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-idl-attributes" style="color:initial">event handler idl attribute</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-global" style="color:initial">global object <small>(for environment settings object)</small></span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-initialise-the-document-object" style="color:initial">initializing the document object</span>
     <li><span class="dfn-paneled" id="term-for-navigate" style="color:initial">navigate</span>
     <li><span class="dfn-paneled" id="term-for-perform-a-microtask-checkpoint" style="color:initial">perform a microtask checkpoint</span>
     <li><span class="dfn-paneled" id="term-for-queue-a-task" style="color:initial">queue a task</span>
     <li><span class="dfn-paneled" id="term-for-concept-relevant-global" style="color:initial">relevant global object</span>
     <li><span class="dfn-paneled" id="term-for-relevant-settings-object" style="color:initial">relevant settings object</span>
     <li><span class="dfn-paneled" id="term-for-responsible-event-loop" style="color:initial">responsible event loop</span>
     <li><span class="dfn-paneled" id="term-for-triggered-by-user-activation" style="color:initial">triggered by user activation</span>
    </ul>
   <li>
    <a data-link-type="biblio">[permissions]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-permissionstate-denied" style="color:initial">"denied"</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-permissiondescriptor" style="color:initial">PermissionDescriptor</span>
     <li><span class="dfn-paneled" id="term-for-permissionstatus" style="color:initial">PermissionStatus</span>
     <li><span class="dfn-paneled" id="term-for-allowed-in-non-secure-contexts" style="color:initial">allowed in non-secure contexts</span>
     <li><span class="dfn-paneled" id="term-for-extra-permission-data" style="color:initial">extra permission data</span>
     <li><span class="dfn-paneled" id="term-for-extra-permission-data-constraints" style="color:initial">extra permission data constraints</span>
     <li><span class="dfn-paneled" id="term-for-extra-permission-data-type" style="color:initial">extra permission data type</span>
     <li><span class="dfn-paneled" id="term-for-dom-permissiondescriptor-name" style="color:initial">name</span>
     <li><span class="dfn-paneled" id="term-for-permission-descriptor-type" style="color:initial">permission descriptor type</span>
     <li><span class="dfn-paneled" id="term-for-permission-query-algorithm" style="color:initial">permission query algorithm</span>
     <li><span class="dfn-paneled" id="term-for-permission-result-type" style="color:initial">permission result type</span>
     <li><span class="dfn-paneled" id="term-for-permission-revocation-algorithm" style="color:initial">permission revocation algorithm</span>
     <li><span class="dfn-paneled" id="term-for-permission-state" style="color:initial">permission state</span>
     <li><span class="dfn-paneled" id="term-for-powerful-feature" style="color:initial">powerful feature</span>
     <li><span class="dfn-paneled" id="term-for-prompt-the-user-to-choose" style="color:initial">prompt the user to choose</span>
     <li><span class="dfn-paneled" id="term-for-dom-permissions-query" style="color:initial">query(permissionDesc)</span>
     <li><span class="dfn-paneled" id="term-for-dom-permissionstatus-state" style="color:initial">state</span>
    </ul>
   <li>
    <a data-link-type="biblio">[PERMISSIONS-REQUEST]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-permission-request-algorithm" style="color:initial">permission request algorithm</span>
     <li><span class="dfn-paneled" id="term-for-dom-permissions-request" style="color:initial">request(permissionDesc)</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-new-promise" style="color:initial">a new promise</span>
     <li><span class="dfn-paneled" id="term-for-a-promise-rejected-with" style="color:initial">a promise rejected with</span>
     <li><span class="dfn-paneled" id="term-for-reject-promise" style="color:initial">reject</span>
     <li><span class="dfn-paneled" id="term-for-upon-fulfillment" style="color:initial">upon fulfillment</span>
     <li><span class="dfn-paneled" id="term-for-waiting-for-all" style="color:initial">waiting for all</span>
    </ul>
   <li>
    <a data-link-type="biblio">[secure-contexts]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-non-secure-contexts" style="color:initial">non-secure contexts</span>
     <li><span class="dfn-paneled" id="term-for-secure-contexts" style="color:initial">secure contexts</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-aborterror" style="color:initial">AbortError</span>
     <li><span class="dfn-paneled" id="term-for-BufferSource" style="color:initial">BufferSource</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMException" style="color:initial">DOMException</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-EnforceRange" style="color:initial">EnforceRange</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-idl-frozen-array" style="color:initial">FrozenArray</span>
     <li><span class="dfn-paneled" id="term-for-invalidmodificationerror" style="color:initial">InvalidModificationError</span>
     <li><span class="dfn-paneled" id="term-for-invalidstateerror" style="color:initial">InvalidStateError</span>
     <li><span class="dfn-paneled" id="term-for-networkerror" style="color:initial">NetworkError</span>
     <li><span class="dfn-paneled" id="term-for-notfounderror" style="color:initial">NotFoundError</span>
     <li><span class="dfn-paneled" id="term-for-notsupportederror" style="color:initial">NotSupportedError</span>
     <li><span class="dfn-paneled" id="term-for-SameObject" style="color:initial">SameObject</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
     <li><span class="dfn-paneled" id="term-for-securityerror" style="color:initial">SecurityError</span>
     <li><span class="dfn-paneled" id="term-for-unknownerror" style="color:initial">UnknownError</span>
     <li><span class="dfn-paneled" id="term-for-dfn-get-buffer-source-copy" style="color:initial">a copy of the bytes held</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-idl-byte" style="color:initial">byte</span>
     <li><span class="dfn-paneled" id="term-for-dfn-convert-idl-to-ecmascript-value" style="color:initial">converted to an ecmascript value</span>
     <li><span class="dfn-paneled" id="term-for-dfn-convert-ecmascript-to-idl-value" style="color:initial">converted to an idl value</span>
     <li><span class="dfn-paneled" id="term-for-dfn-maplike" style="color:initial">maplike</span>
     <li><span class="dfn-paneled" id="term-for-idl-object" style="color:initial">object</span>
     <li><span class="dfn-paneled" id="term-for-idl-unsigned-long" style="color:initial">unsigned long</span>
     <li><span class="dfn-paneled" id="term-for-idl-unsigned-short" style="color:initial">unsigned short</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-bluetooth-assigned">[BLUETOOTH-ASSIGNED]
   <dd><a href="https://www.bluetooth.org/en-us/specification/assigned-numbers">Assigned Numbers</a>. Living Standard. URL: <a href="https://www.bluetooth.org/en-us/specification/assigned-numbers">https://www.bluetooth.org/en-us/specification/assigned-numbers</a>
   <dt id="biblio-bluetooth-assigned-characteristics">[BLUETOOTH-ASSIGNED-CHARACTERISTICS]
   <dd><a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx">Bluetooth GATT Specifications > Characteristics</a>. Living Standard. URL: <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx</a>
   <dt id="biblio-bluetooth-assigned-descriptors">[BLUETOOTH-ASSIGNED-DESCRIPTORS]
   <dd><a href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx">Bluetooth GATT Specifications > Descriptors</a>. Living Standard. URL: <a href="https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx">https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx</a>
   <dt id="biblio-bluetooth-assigned-services">[BLUETOOTH-ASSIGNED-SERVICES]
   <dd><a href="https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx">Bluetooth GATT Specifications > Services</a>. Living Standard. URL: <a href="https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx">https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx</a>
   <dt id="biblio-bluetooth-supplement6">[BLUETOOTH-SUPPLEMENT6]
   <dd><a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735">Supplement to the Bluetooth Core Specification Version 6</a>. 14 July 2015. URL: <a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735">https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735</a>
   <dt id="biblio-bluetooth42">[BLUETOOTH42]
   <dd><a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439">BLUETOOTH SPECIFICATION Version 4.2</a>. 2 December 2014. URL: <a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439">https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-ecmascript">[ECMAScript]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
   <dt id="biblio-encoding">[ENCODING]
   <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/">Encoding Standard</a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-permissions">[PERMISSIONS]
   <dd>Mounir Lamouri; Marcos Caceres; Jeffrey Yasskin. <a href="https://www.w3.org/TR/permissions/">Permissions</a>. 25 September 2017. WD. URL: <a href="https://www.w3.org/TR/permissions/">https://www.w3.org/TR/permissions/</a>
   <dt id="biblio-permissions-request">[PERMISSIONS-REQUEST]
   <dd><a href="https://wicg.github.io/permissions-request/">Requesting Permissions</a>. Living Standard. URL: <a href="https://wicg.github.io/permissions-request/">https://wicg.github.io/permissions-request/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-rfc4122">[RFC4122]
   <dd>P. Leach; M. Mealling; R. Salz. <a href="https://tools.ietf.org/html/rfc4122">A Universally Unique IDentifier (UUID) URN Namespace</a>. July 2005. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc4122">https://tools.ietf.org/html/rfc4122</a>
   <dt id="biblio-secure-contexts">[SECURE-CONTEXTS]
   <dd>Mike West. <a href="https://www.w3.org/TR/secure-contexts/">Secure Contexts</a>. 15 September 2016. CR. URL: <a href="https://www.w3.org/TR/secure-contexts/">https://www.w3.org/TR/secure-contexts/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-csp3">[CSP3]
   <dd>Mike West. <a href="https://www.w3.org/TR/CSP3/">Content Security Policy Level 3</a>. 15 October 2018. WD. URL: <a href="https://www.w3.org/TR/CSP3/">https://www.w3.org/TR/CSP3/</a>
   <dt id="biblio-fingerprinting-guidance">[FINGERPRINTING-GUIDANCE]
   <dd>Nick Doty. <a href="https://www.w3.org/TR/fingerprinting-guidance/">Mitigating Browser Fingerprinting in Web Specifications</a>. 28 March 2019. NOTE. URL: <a href="https://www.w3.org/TR/fingerprinting-guidance/">https://www.w3.org/TR/fingerprinting-guidance/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def"><c- b>dictionary</c-> <a href="#dictdef-bluetoothdatafilterinit"><code><c- g>BluetoothDataFilterInit</c-></code></a> {
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑧"><c- n>BufferSource</c-></a> <a data-type="BufferSource " href="#dom-bluetoothdatafilterinit-dataprefix"><code><c- g>dataPrefix</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource①①"><c- n>BufferSource</c-></a> <a data-type="BufferSource " href="#dom-bluetoothdatafilterinit-mask"><code><c- g>mask</c-></code></a>;
};
<c- b>dictionary</c-> <a href="#dictdef-bluetoothlescanfilterinit"><code><c- g>BluetoothLEScanFilterInit</c-></code></a> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑨"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services④"><c- g>services</c-></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②⓪"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name③"><c- g>name</c-></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑨"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix③"><c- g>namePrefix</c-></a>;
  // Maps unsigned shorts to BluetoothDataFilters.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object②"><c- b>object</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="object " href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata⑤"><c- g>manufacturerData</c-></a>;
  // Maps BluetoothServiceUUIDs to BluetoothDataFilters.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①①"><c- b>object</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="object " href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata⑥"><c- g>serviceData</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-requestdeviceoptions"><code><c- g>RequestDeviceOptions</c-></code></a> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit⑤"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑦"><c- g>filters</c-></a>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid①①"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices④"><c- g>optionalServices</c-></a> = [];
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⑦"><c- b>boolean</c-></a> <a class="idl-code" data-default="false" data-link-type="dict-member" data-type="boolean " href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑨"><c- g>acceptAllDevices</c-></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①③"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①⑥"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a href="#bluetooth"><code><c- g>Bluetooth</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget④"><c- n>EventTarget</c-></a> {
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⑥"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability①①"><c- g>getAvailability</c-></a>();
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑦"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-bluetooth-onavailabilitychanged"><code><c- g>onavailabilitychanged</c-></code></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑨"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice④②"><c- n>BluetoothDevice</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice?" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice④"><c- g>referringDevice</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①①⓪"><c- n>BluetoothDevice</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice②①"><c- g>requestDevice</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-requestdeviceoptions" id="ref-for-dictdef-requestdeviceoptions①"><c- n>RequestDeviceOptions</c-></a> <a href="#dom-bluetooth-requestdevice-options-options"><code><c- g>options</c-></code></a> = {});
};
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①③"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers②"><c- n>BluetoothDeviceEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①②"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers④"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth②①"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers③"><c- n>ServiceEventHandlers</c-></a>;

<c- b>dictionary</c-> <a href="#dictdef-bluetoothpermissiondescriptor"><code><c- g>BluetoothPermissionDescriptor</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-bluetoothpermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code></a>;
  // These match RequestDeviceOptions.
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit④①"><c- n>BluetoothLEScanFilterInit</c-></a>> <a data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-bluetoothpermissiondescriptor-filters"><code><c- g>filters</c-></code></a>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid③①"><c- n>BluetoothServiceUUID</c-></a>> <a data-default="[]" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothpermissiondescriptor-optionalservices"><code><c- g>optionalServices</c-></code></a> = [];
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-bluetoothpermissiondescriptor-acceptalldevices"><code><c- g>acceptAllDevices</c-></code></a> = <c- b>false</c->;
};

<c- b>dictionary</c-> <a href="#dictdef-allowedbluetoothdevice"><code><c- g>AllowedBluetoothDevice</c-></code></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-allowedbluetoothdevice-deviceid"><code><c- g>deviceId</c-></code></a>;
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③①"><c- b>boolean</c-></a> <a data-type="boolean " href="#dom-allowedbluetoothdevice-mayusegatt"><code><c- g>mayUseGATT</c-></code></a>;
  // An allowedServices of "all" means all services are allowed.
  <c- b>required</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④①"><c- b>DOMString</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①②"><c- n>UUID</c-></a>>) <a data-type="(DOMString or sequence<UUID>) " href="#dom-allowedbluetoothdevice-allowedservices"><code><c- g>allowedServices</c-></code></a>;
};
<c- b>dictionary</c-> <a href="#dictdef-bluetoothpermissiondata"><code><c- g>BluetoothPermissionData</c-></code></a> {
  <c- b>required</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice④"><c- n>AllowedBluetoothDevice</c-></a>> <a data-type="sequence<AllowedBluetoothDevice> " href="#dom-bluetoothpermissiondata-alloweddevices"><code><c- g>allowedDevices</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①④"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#bluetoothpermissionresult"><code><c- g>BluetoothPermissionResult</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#permissionstatus" id="ref-for-permissionstatus①"><c- n>PermissionStatus</c-></a> {
  <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑧①"><c- n>BluetoothDevice</c-></a>> <a data-type="FrozenArray<BluetoothDevice>" href="#dom-bluetoothpermissionresult-devices"><code><c- g>devices</c-></code></a>;
};

[
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=<c- n>Window</c->,
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①⑤"><c- g>SecureContext</c-></a>
]
<c- b>interface</c-> <a href="#valueevent"><code><c- g>ValueEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event②"><c- n>Event</c-></a> {
  <a href="#dom-valueevent-valueevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤①"><c- b>DOMString</c-></a> <a href="#dom-valueevent-valueevent-type-initdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-valueeventinit" id="ref-for-dictdef-valueeventinit①"><c- n>ValueEventInit</c-></a> <a href="#dom-valueevent-valueevent-type-initdict-initdict"><code><c- g>initDict</c-></code></a> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#dom-valueevent-value" id="ref-for-dom-valueevent-value①①"><c- g>value</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-valueeventinit"><code><c- g>ValueEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit②"><c- n>EventInit</c-></a> {
  <c- b>any</c-> <a data-default="null" data-type="any " href="#dom-valueeventinit-value"><code><c- g>value</c-></code></a> = <c- b>null</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothdevice" id="ref-for-bluetoothdevice①①①"><c- g>BluetoothDevice</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id②①"><c- g>id</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑦①"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothdevice-name" id="ref-for-dom-bluetoothdevice-name①"><c- g>name</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①④"><c- n>BluetoothRemoteGATTServer</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTServer?" href="#dom-bluetoothdevice-gatt" id="ref-for-dom-bluetoothdevice-gatt②"><c- g>gatt</c-></a>;

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements①"><c- g>watchAdvertisements</c-></a>();
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-unwatchadvertisements" id="ref-for-dom-bluetoothdevice-unwatchadvertisements②"><c- g>unwatchAdvertisements</c-></a>();
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements⑦"><c- g>watchingAdvertisements</c-></a>;
};
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①②①"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers①①"><c- n>BluetoothDeviceEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①③①"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers①①"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①④①"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers①①"><c- n>ServiceEventHandlers</c-></a>;

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap④"><c- g>BluetoothManufacturerDataMap</c-></a> {
  <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short④"><c- b>unsigned</c-> <c- b>short</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⑦"><c- b>DataView</c-></a>>;
};
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap④"><c- g>BluetoothServiceDataMap</c-></a> {
  <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①①"><c- n>UUID</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor②①"><c- b>DataView</c-></a>>;
};
[
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑥①"><c- g>Exposed</c-></a>=<c- n>Window</c->,
  <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤①"><c- g>SecureContext</c-></a>
]
<c- b>interface</c-> <a href="#bluetoothadvertisingevent"><code><c- g>BluetoothAdvertisingEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①①"><c- n>Event</c-></a> {
  <a class="idl-code" data-link-type="constructor" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent" id="ref-for-dom-bluetoothadvertisingevent-bluetoothadvertisingevent①"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑧①"><c- b>DOMString</c-></a> <a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"><code><c- g>type</c-></code></a>, <a class="n" data-link-type="idl-name" href="#dictdef-bluetoothadvertisingeventinit" id="ref-for-dictdef-bluetoothadvertisingeventinit①"><c- n>BluetoothAdvertisingEventInit</c-></a> <a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"><code><c- g>init</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②②①"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device③"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid②①"><c- n>UUID</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<UUID>" href="#dom-bluetoothadvertisingevent-uuids" id="ref-for-dom-bluetoothadvertisingevent-uuids①"><c- g>uuids</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑨①"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothadvertisingevent-name" id="ref-for-dom-bluetoothadvertisingevent-name①"><c- g>name</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short①①"><c- b>unsigned</c-> <c- b>short</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned short?" href="#dom-bluetoothadvertisingevent-appearance" id="ref-for-dom-bluetoothadvertisingevent-appearance①"><c- g>appearance</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte④"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-txpower" id="ref-for-dom-bluetoothadvertisingevent-txpower①"><c- g>txPower</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte①①"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-rssi" id="ref-for-dom-bluetoothadvertisingevent-rssi①"><c- g>rssi</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap①①"><c- n>BluetoothManufacturerDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothManufacturerDataMap" href="#dom-bluetoothadvertisingevent-manufacturerdata" id="ref-for-dom-bluetoothadvertisingevent-manufacturerdata①"><c- g>manufacturerData</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap①①"><c- n>BluetoothServiceDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothServiceDataMap" href="#dom-bluetoothadvertisingevent-servicedata" id="ref-for-dom-bluetoothadvertisingevent-servicedata①"><c- g>serviceData</c-></a>;
};
<c- b>dictionary</c-> <a href="#dictdef-bluetoothadvertisingeventinit"><code><c- g>BluetoothAdvertisingEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①①"><c- n>EventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②③①"><c- n>BluetoothDevice</c-></a> <a data-type="BluetoothDevice " href="#dom-bluetoothadvertisingeventinit-device"><code><c- g>device</c-></code></a>;
  <c- b>sequence</c->&lt;(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⓪①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑧"><c- b>unsigned</c-> <c- b>long</c-></a>)> <a data-type="sequence<(DOMString or unsigned long)> " href="#dom-bluetoothadvertisingeventinit-uuids"><code><c- g>uuids</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-bluetoothadvertisingeventinit-name"><code><c- g>name</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short②①"><c- b>unsigned</c-> <c- b>short</c-></a> <a data-type="unsigned short " href="#dom-bluetoothadvertisingeventinit-appearance"><code><c- g>appearance</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte②①"><c- b>byte</c-></a> <a data-type="byte " href="#dom-bluetoothadvertisingeventinit-txpower"><code><c- g>txPower</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-byte" id="ref-for-idl-byte③①"><c- b>byte</c-></a> <a data-type="byte " href="#dom-bluetoothadvertisingeventinit-rssi"><code><c- g>rssi</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap②①"><c- n>BluetoothManufacturerDataMap</c-></a> <a data-type="BluetoothManufacturerDataMap " href="#dom-bluetoothadvertisingeventinit-manufacturerdata"><code><c- g>manufacturerData</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap②①"><c- n>BluetoothServiceDataMap</c-></a> <a data-type="BluetoothServiceDataMap " href="#dom-bluetoothadvertisingeventinit-servicedata"><code><c- g>serviceData</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑦①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑥①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑤①"><c- g>BluetoothRemoteGATTServer</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject④①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⓪①"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattserver-device" id="ref-for-dom-bluetoothremotegattserver-device①①"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected②①"><c- g>connected</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑥①"><c- n>BluetoothRemoteGATTServer</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect①①"><c- g>connect</c-></a>();
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect①①"><c- g>disconnect</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑥①"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservice" id="ref-for-dom-bluetoothremotegattserver-getprimaryservice①①"><c- g>getPrimaryService</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid④①"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattserver-getprimaryservice-service-service"><code><c- g>service</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑦①"><c- n>BluetoothRemoteGATTService</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservices" id="ref-for-dom-bluetoothremotegattserver-getprimaryservices①"><c- g>getPrimaryServices</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑤①"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattserver-getprimaryservices-service-service"><code><c- g>service</c-></code></a>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑧①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑦①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑨①"><c- g>BluetoothRemoteGATTService</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget②①"><c- n>EventTarget</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑤①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③③①"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device②①"><c- g>device</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid④①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattservice-uuid" id="ref-for-dom-bluetoothremotegattservice-uuid①"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattservice-isprimary" id="ref-for-dom-bluetoothremotegattservice-isprimary①①"><c- g>isPrimary</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑦①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic④①"><c- g>getCharacteristic</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid③"><c- n>BluetoothCharacteristicUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"><code><c- g>characteristic</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑧①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristics" id="ref-for-dom-bluetoothremotegattservice-getcharacteristics①"><c- g>getCharacteristics</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid①①"><c- n>BluetoothCharacteristicUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"><code><c- g>characteristic</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⓪①"><c- n>BluetoothRemoteGATTService</c-></a>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservice" id="ref-for-dom-bluetoothremotegattservice-getincludedservice①①"><c- g>getIncludedService</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑥①"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getincludedservice-service-service"><code><c- g>service</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①①①"><c- n>BluetoothRemoteGATTService</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservices" id="ref-for-dom-bluetoothremotegattservice-getincludedservices①"><c- g>getIncludedServices</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑦①"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getincludedservices-service-service"><code><c- g>service</c-></code></a>);
};
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①②①"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers②①"><c- n>CharacteristicEventHandlers</c-></a>;
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①③①"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers②①"><c- n>ServiceEventHandlers</c-></a>;

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑨①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑧①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⓪①"><c- g>BluetoothRemoteGATTCharacteristic</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget③①"><c- n>EventTarget</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑥①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑦①"><c- n>BluetoothRemoteGATTService</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTService" href="#dom-bluetoothremotegattcharacteristic-service" id="ref-for-dom-bluetoothremotegattcharacteristic-service①①"><c- g>service</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑤①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattcharacteristic-uuid" id="ref-for-dom-bluetoothremotegattcharacteristic-uuid①"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties①①"><c- n>BluetoothCharacteristicProperties</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothCharacteristicProperties" href="#dom-bluetoothremotegattcharacteristic-properties" id="ref-for-dom-bluetoothremotegattcharacteristic-properties①"><c- g>properties</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑦①"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value②①"><c- g>value</c-></a>;
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑤①"><c- n>BluetoothRemoteGATTDescriptor</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptor" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor①①"><c- g>getDescriptor</c-></a>(<a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid③"><c- n>BluetoothDescriptorUUID</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"><code><c- g>descriptor</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑥①"><c- n>BluetoothRemoteGATTDescriptor</c-></a>>>
    <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptors" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptors①"><c- g>getDescriptors</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid①①"><c- n>BluetoothDescriptorUUID</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"><code><c- g>descriptor</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑧①"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue①①"><c- g>readValue</c-></a>();
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevalue" id="ref-for-dom-bluetoothremotegattcharacteristic-writevalue①①"><c- g>writeValue</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource④①"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevalue-value-value"><code><c- g>value</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse①"><c- g>writeValueWithResponse</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑤①"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"><code><c- g>value</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse①"><c- g>writeValueWithoutResponse</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑥①"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"><code><c- g>value</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①①①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications①①"><c- g>startNotifications</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①②①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-stopnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-stopnotifications①"><c- g>stopNotifications</c-></a>();
};
<a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①③①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <c- b>includes</c-> <a class="n" data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers③①"><c- n>CharacteristicEventHandlers</c-></a>;

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①⓪①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑨①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties③①"><c- g>BluetoothCharacteristicProperties</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-broadcast"><code><c- g>broadcast</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-read"><code><c- g>read</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑨①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-writewithoutresponse"><code><c- g>writeWithoutResponse</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⓪①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-write"><code><c- g>write</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-notify"><code><c- g>notify</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①②①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-indicate"><code><c- g>indicate</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①③①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"><code><c- g>authenticatedSignedWrites</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①④①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-reliablewrite"><code><c- g>reliableWrite</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⑤①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-writableauxiliaries"><code><c- g>writableAuxiliaries</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①⓪①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑧①"><c- g>BluetoothRemoteGATTDescriptor</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑦①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑧①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTCharacteristic" href="#dom-bluetoothremotegattdescriptor-characteristic" id="ref-for-dom-bluetoothremotegattdescriptor-characteristic①"><c- g>characteristic</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑥①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattdescriptor-uuid" id="ref-for-dom-bluetoothremotegattdescriptor-uuid①"><c- g>uuid</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①①①"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattdescriptor-value" id="ref-for-dom-bluetoothremotegattdescriptor-value①"><c- g>value</c-></a>;
  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①②①"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-readvalue" id="ref-for-dom-bluetoothremotegattdescriptor-readvalue①"><c- g>readValue</c-></a>();
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-writevalue" id="ref-for-dom-bluetoothremotegattdescriptor-writevalue①"><c- g>writeValue</c-></a>(<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource⑦①"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattdescriptor-writevalue-value-value"><code><c- g>value</c-></code></a>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <a href="#characteristiceventhandlers"><code><c- g>CharacteristicEventHandlers</c-></code></a> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged" id="ref-for-dom-characteristiceventhandlers-oncharacteristicvaluechanged①"><c- g>oncharacteristicvaluechanged</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①②①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <a href="#bluetoothdeviceeventhandlers"><code><c- g>BluetoothDeviceEventHandlers</c-></code></a> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived" id="ref-for-dom-bluetoothdeviceeventhandlers-onadvertisementreceived①"><c- g>onadvertisementreceived</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected" id="ref-for-dom-bluetoothdeviceeventhandlers-ongattserverdisconnected①"><c- g>ongattserverdisconnected</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①③①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <c- b>mixin</c-> <a href="#serviceeventhandlers"><code><c- g>ServiceEventHandlers</c-></code></a> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceadded" id="ref-for-dom-serviceeventhandlers-onserviceadded①"><c- g>onserviceadded</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onservicechanged" id="ref-for-dom-serviceeventhandlers-onservicechanged①"><c- g>onservicechanged</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceremoved" id="ref-for-dom-serviceeventhandlers-onserviceremoved①"><c- g>onserviceremoved</c-></a>;
};

<c- b>typedef</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①②①"><c- b>DOMString</c-></a> <a href="#typedefdef-uuid"><code><c- g>UUID</c-></code></a>;
[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①②①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
<c- b>interface</c-> <a href="#bluetoothuuid"><code><c- g>BluetoothUUID</c-></code></a> {
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑦①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①①①"><c- g>getService</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①③①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long①①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getservice-name-name"><code><c- g>name</c-></code></a>);
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑧①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic②①"><c- g>getCharacteristic</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①④①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long②①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getcharacteristic-name-name"><code><c- g>name</c-></code></a>);
  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑨①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor②①"><c- g>getDescriptor</c-></a>((<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑤①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long③①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getdescriptor-name-name"><code><c- g>name</c-></code></a>);

  <c- b>static</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①⓪①"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid①①"><c- g>canonicalUUID</c-></a>([<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#EnforceRange" id="ref-for-EnforceRange①"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long④①"><c- b>unsigned</c-> <c- b>long</c-></a> <a href="#dom-bluetoothuuid-canonicaluuid-alias-alias"><code><c- g>alias</c-></code></a>);
};

<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑥①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑤①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑧①"><c- g>BluetoothServiceUUID</c-></a>;
<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑦①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑥①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid②①"><c- g>BluetoothCharacteristicUUID</c-></a>;
<c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑧①"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑦①"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid②①"><c- g>BluetoothDescriptorUUID</c-></a>;

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①④①"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator①"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑧①"><c- g>SameObject</c-></a>]
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①①①"><c- n>Bluetooth</c-></a> <a data-readonly data-type="Bluetooth" href="#dom-navigator-bluetooth"><code><c- g>bluetooth</c-></code></a>;
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue">TODO: Nail down the amount of time.<a href="#issue-2f91a41d"> ↵ </a></div>
   <div class="issue"> Both <a data-link-type="dfn" href="#passive-scanning">passive scanning</a> and
          the <a data-link-type="dfn" href="#privacy-feature">Privacy Feature</a> avoid leaking the unique, immutable device ID.
          We ought to require UAs to use either one,
          but none of the OS APIs appear to expose either.
          Bluetooth also makes it hard to use <a data-link-type="dfn" href="#passive-scanning">passive scanning</a> since
          it doesn’t require <a data-link-type="dfn" href="#central">Central</a> devices to support the <a data-link-type="dfn" href="#observation-procedure">Observation Procedure</a>. <a href="#issue-b71bd84d"> ↵ </a></div>
   <div class="issue"> All forms of BR/EDR inquiry/discovery
          appear to leak the unique, immutable device address. <a href="#issue-9bb159fd"> ↵ </a></div>
   <div class="issue"> We need a way for a site to register to receive an event
    when an interesting device comes within range. <a href="#issue-ad5723d8"> ↵ </a></div>
   <div class="issue"> Such a generic event type belongs in <a data-link-type="biblio" href="#biblio-html">[HTML]</a> or <a data-link-type="biblio" href="#biblio-dom">[DOM]</a>, not here. <a href="#ValueEvent-too-generic"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
          but for now sites need to serialize their use of this API
          and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f①"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f②"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
          but for now sites need to serialize their use of this API
          and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f③"> ↵ </a></div>
   <div class="issue"> <a data-link-type="dfn" href="#characteristic-extended-properties">Characteristic Extended Properties</a> isn’t clear whether
                  the extended properties are immutable for a given Characteristic.
                  If they are, the UA should be allowed to cache them. <a href="#issue-997f7afd"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f④"> ↵ </a></div>
   <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code>,
              but for now sites need to serialize their use of this API
              and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">&lt;https://github.com/WebBluetoothCG/web-bluetooth/issues/188></a><a href="#issue-f363405f⑤"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="dictdef-bluetoothdatafilterinit">
   <b><a href="#dictdef-bluetoothdatafilterinit">#dictdef-bluetoothdatafilterinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothdatafilterinit">3. Device Discovery</a> <a href="#ref-for-dictdef-bluetoothdatafilterinit①">(2)</a> <a href="#ref-for-dictdef-bluetoothdatafilterinit②">(3)</a> <a href="#ref-for-dictdef-bluetoothdatafilterinit③">(4)</a> <a href="#ref-for-dictdef-bluetoothdatafilterinit④">(5)</a> <a href="#ref-for-dictdef-bluetoothdatafilterinit⑤">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdatafilterinit-dataprefix">
   <b><a href="#dom-bluetoothdatafilterinit-dataprefix">#dom-bluetoothdatafilterinit-dataprefix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdatafilterinit-dataprefix">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothdatafilterinit-dataprefix①">(2)</a> <a href="#ref-for-dom-bluetoothdatafilterinit-dataprefix②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdatafilterinit-mask">
   <b><a href="#dom-bluetoothdatafilterinit-mask">#dom-bluetoothdatafilterinit-mask</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdatafilterinit-mask">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothdatafilterinit-mask①">(2)</a> <a href="#ref-for-dom-bluetoothdatafilterinit-mask②">(3)</a> <a href="#ref-for-dom-bluetoothdatafilterinit-mask③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-bluetoothlescanfilterinit">
   <b><a href="#dictdef-bluetoothlescanfilterinit">#dictdef-bluetoothlescanfilterinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothlescanfilterinit">3. Device Discovery</a> <a href="#ref-for-dictdef-bluetoothlescanfilterinit①">(2)</a> <a href="#ref-for-dictdef-bluetoothlescanfilterinit②">(3)</a> <a href="#ref-for-dictdef-bluetoothlescanfilterinit③">(4)</a>
    <li><a href="#ref-for-dictdef-bluetoothlescanfilterinit④">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-requestdeviceoptions">
   <b><a href="#dictdef-requestdeviceoptions">#dictdef-requestdeviceoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-requestdeviceoptions">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetooth">
   <b><a href="#bluetooth">#bluetooth</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetooth">3. Device Discovery</a> <a href="#ref-for-bluetooth①">(2)</a> <a href="#ref-for-bluetooth②">(3)</a> <a href="#ref-for-bluetooth③">(4)</a> <a href="#ref-for-bluetooth④">(5)</a>
    <li><a href="#ref-for-bluetooth⑤">4.2. BluetoothDevice</a> <a href="#ref-for-bluetooth⑥">(2)</a> <a href="#ref-for-bluetooth⑦">(3)</a>
    <li><a href="#ref-for-bluetooth⑧">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-bluetooth⑨">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-bluetooth①⓪">5.6.2. Event types</a>
    <li><a href="#ref-for-bluetooth①①">8. Extensions to the Navigator Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-requestdeviceoptions-filters">
   <b><a href="#dom-requestdeviceoptions-filters">#dom-requestdeviceoptions-filters</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-requestdeviceoptions-filters">3. Device Discovery</a> <a href="#ref-for-dom-requestdeviceoptions-filters①">(2)</a> <a href="#ref-for-dom-requestdeviceoptions-filters②">(3)</a> <a href="#ref-for-dom-requestdeviceoptions-filters③">(4)</a> <a href="#ref-for-dom-requestdeviceoptions-filters④">(5)</a> <a href="#ref-for-dom-requestdeviceoptions-filters⑤">(6)</a> <a href="#ref-for-dom-requestdeviceoptions-filters⑥">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothlescanfilterinit-services">
   <b><a href="#dom-bluetoothlescanfilterinit-services">#dom-bluetoothlescanfilterinit-services</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothlescanfilterinit-services">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-services①">(2)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-services②">(3)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-services③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothlescanfilterinit-name">
   <b><a href="#dom-bluetoothlescanfilterinit-name">#dom-bluetoothlescanfilterinit-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothlescanfilterinit-name">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-name①">(2)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-name②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothlescanfilterinit-nameprefix">
   <b><a href="#dom-bluetoothlescanfilterinit-nameprefix">#dom-bluetoothlescanfilterinit-nameprefix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothlescanfilterinit-nameprefix">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-nameprefix①">(2)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-nameprefix②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothlescanfilterinit-manufacturerdata">
   <b><a href="#dom-bluetoothlescanfilterinit-manufacturerdata">#dom-bluetoothlescanfilterinit-manufacturerdata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata①">(2)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata②">(3)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata③">(4)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothlescanfilterinit-servicedata">
   <b><a href="#dom-bluetoothlescanfilterinit-servicedata">#dom-bluetoothlescanfilterinit-servicedata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata①">(2)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata②">(3)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata③">(4)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata④">(5)</a> <a href="#ref-for-dom-bluetoothlescanfilterinit-servicedata⑤">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-requestdeviceoptions-acceptalldevices">
   <b><a href="#dom-requestdeviceoptions-acceptalldevices">#dom-requestdeviceoptions-acceptalldevices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-requestdeviceoptions-acceptalldevices">3. Device Discovery</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices①">(2)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices②">(3)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices③">(4)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices④">(5)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices⑤">(6)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices⑥">(7)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices⑦">(8)</a> <a href="#ref-for-dom-requestdeviceoptions-acceptalldevices⑧">(9)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-requestdeviceoptions-optionalservices">
   <b><a href="#dom-requestdeviceoptions-optionalservices">#dom-requestdeviceoptions-optionalservices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-requestdeviceoptions-optionalservices">3. Device Discovery</a> <a href="#ref-for-dom-requestdeviceoptions-optionalservices①">(2)</a> <a href="#ref-for-dom-requestdeviceoptions-optionalservices②">(3)</a> <a href="#ref-for-dom-requestdeviceoptions-optionalservices③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-deviceinstancemap-slot">
   <b><a href="#dom-bluetooth-deviceinstancemap-slot">#dom-bluetooth-deviceinstancemap-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-deviceinstancemap-slot">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetooth-deviceinstancemap-slot①">(2)</a> <a href="#ref-for-dom-bluetooth-deviceinstancemap-slot②">(3)</a>
    <li><a href="#ref-for-dom-bluetooth-deviceinstancemap-slot③">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-attributeinstancemap-slot">
   <b><a href="#dom-bluetooth-attributeinstancemap-slot">#dom-bluetooth-attributeinstancemap-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-attributeinstancemap-slot">5.1.2. The Bluetooth cache</a> <a href="#ref-for-dom-bluetooth-attributeinstancemap-slot①">(2)</a> <a href="#ref-for-dom-bluetooth-attributeinstancemap-slot②">(3)</a>
    <li><a href="#ref-for-dom-bluetooth-attributeinstancemap-slot③">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-dom-bluetooth-attributeinstancemap-slot④">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-referringdevice-slot">
   <b><a href="#dom-bluetooth-referringdevice-slot">#dom-bluetooth-referringdevice-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-referringdevice-slot">3. Device Discovery</a> <a href="#ref-for-dom-bluetooth-referringdevice-slot①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-referringdevice">
   <b><a href="#dom-bluetooth-referringdevice">#dom-bluetooth-referringdevice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-referringdevice">3. Device Discovery</a> <a href="#ref-for-dom-bluetooth-referringdevice①">(2)</a> <a href="#ref-for-dom-bluetooth-referringdevice②">(3)</a>
    <li><a href="#ref-for-dom-bluetooth-referringdevice③">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="matches-a-filter">
   <b><a href="#matches-a-filter">#matches-a-filter</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-matches-a-filter">3. Device Discovery</a> <a href="#ref-for-matches-a-filter①">(2)</a> <a href="#ref-for-matches-a-filter②">(3)</a>
    <li><a href="#ref-for-matches-a-filter③">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothdatafilterinit-matches">
   <b><a href="#bluetoothdatafilterinit-matches">#bluetoothdatafilterinit-matches</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothdatafilterinit-matches">3. Device Discovery</a> <a href="#ref-for-bluetoothdatafilterinit-matches①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-requestdevice">
   <b><a href="#dom-bluetooth-requestdevice">#dom-bluetooth-requestdevice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-requestdevice">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetooth-requestdevice①">2.1. Device access is powerful</a>
    <li><a href="#ref-for-dom-bluetooth-requestdevice②">3. Device Discovery</a> <a href="#ref-for-dom-bluetooth-requestdevice③">(2)</a>
    <li><a href="#ref-for-dom-bluetooth-requestdevice④">3.1. Permission API Integration</a>
    <li><a href="#ref-for-dom-bluetooth-requestdevice⑤">3.2. Overall Bluetooth availability</a>
    <li><a href="#ref-for-dom-bluetooth-requestdevice⑥">9. Terminology and Conventions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="request-bluetooth-devices">
   <b><a href="#request-bluetooth-devices">#request-bluetooth-devices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-bluetooth-devices">3. Device Discovery</a>
    <li><a href="#ref-for-request-bluetooth-devices①">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothlescanfilterinit-canonicalizing">
   <b><a href="#bluetoothlescanfilterinit-canonicalizing">#bluetoothlescanfilterinit-canonicalizing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothlescanfilterinit-canonicalizing">3. Device Discovery</a>
    <li><a href="#ref-for-bluetoothlescanfilterinit-canonicalizing①">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothdatafilterinit-canonicalizing">
   <b><a href="#bluetoothdatafilterinit-canonicalizing">#bluetoothdatafilterinit-canonicalizing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothdatafilterinit-canonicalizing">3. Device Discovery</a> <a href="#ref-for-bluetoothdatafilterinit-canonicalizing①">(2)</a> <a href="#ref-for-bluetoothdatafilterinit-canonicalizing②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="scan-for-devices">
   <b><a href="#scan-for-devices">#scan-for-devices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scan-for-devices">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-bluetooth">
   <b><a href="#dom-permissionname-bluetooth">#dom-permissionname-bluetooth</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-bluetooth">3. Device Discovery</a> <a href="#ref-for-dom-permissionname-bluetooth①">(2)</a>
    <li><a href="#ref-for-dom-permissionname-bluetooth②">3.1. Permission API Integration</a> <a href="#ref-for-dom-permissionname-bluetooth③">(2)</a> <a href="#ref-for-dom-permissionname-bluetooth④">(3)</a>
    <li><a href="#ref-for-dom-permissionname-bluetooth⑤">4.2. BluetoothDevice</a> <a href="#ref-for-dom-permissionname-bluetooth⑥">(2)</a>
    <li><a href="#ref-for-dom-permissionname-bluetooth⑦">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-bluetoothpermissiondescriptor">
   <b><a href="#dictdef-bluetoothpermissiondescriptor">#dictdef-bluetoothpermissiondescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothpermissiondescriptor">3.1. Permission API Integration</a> <a href="#ref-for-dictdef-bluetoothpermissiondescriptor①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissiondescriptor-deviceid">
   <b><a href="#dom-bluetoothpermissiondescriptor-deviceid">#dom-bluetoothpermissiondescriptor-deviceid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissiondescriptor-deviceid">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissiondescriptor-filters">
   <b><a href="#dom-bluetoothpermissiondescriptor-filters">#dom-bluetoothpermissiondescriptor-filters</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissiondescriptor-filters">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-filters①">(2)</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-filters②">(3)</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-filters③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissiondescriptor-optionalservices">
   <b><a href="#dom-bluetoothpermissiondescriptor-optionalservices">#dom-bluetoothpermissiondescriptor-optionalservices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissiondescriptor-optionalservices">3.1. Permission API Integration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissiondescriptor-acceptalldevices">
   <b><a href="#dom-bluetoothpermissiondescriptor-acceptalldevices">#dom-bluetoothpermissiondescriptor-acceptalldevices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices①">(2)</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices②">(3)</a> <a href="#ref-for-dom-bluetoothpermissiondescriptor-acceptalldevices③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-allowedbluetoothdevice">
   <b><a href="#dictdef-allowedbluetoothdevice">#dictdef-allowedbluetoothdevice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-allowedbluetoothdevice">3.1. Permission API Integration</a> <a href="#ref-for-dictdef-allowedbluetoothdevice①">(2)</a> <a href="#ref-for-dictdef-allowedbluetoothdevice②">(3)</a>
    <li><a href="#ref-for-dictdef-allowedbluetoothdevice③">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-allowedbluetoothdevice-deviceid">
   <b><a href="#dom-allowedbluetoothdevice-deviceid">#dom-allowedbluetoothdevice-deviceid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-deviceid">3.1. Permission API Integration</a> <a href="#ref-for-dom-allowedbluetoothdevice-deviceid①">(2)</a> <a href="#ref-for-dom-allowedbluetoothdevice-deviceid②">(3)</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-deviceid③">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-allowedbluetoothdevice-mayusegatt">
   <b><a href="#dom-allowedbluetoothdevice-mayusegatt">#dom-allowedbluetoothdevice-mayusegatt</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-mayusegatt">3. Device Discovery</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-mayusegatt①">3.1. Permission API Integration</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-mayusegatt②">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-allowedbluetoothdevice-allowedservices">
   <b><a href="#dom-allowedbluetoothdevice-allowedservices">#dom-allowedbluetoothdevice-allowedservices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-allowedservices">3. Device Discovery</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-allowedservices①">3.1. Permission API Integration</a> <a href="#ref-for-dom-allowedbluetoothdevice-allowedservices②">(2)</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-allowedservices③">4.2. BluetoothDevice</a> <a href="#ref-for-dom-allowedbluetoothdevice-allowedservices④">(2)</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-allowedservices⑤">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-bluetoothpermissiondata">
   <b><a href="#dictdef-bluetoothpermissiondata">#dictdef-bluetoothpermissiondata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothpermissiondata">3.1. Permission API Integration</a> <a href="#ref-for-dictdef-bluetoothpermissiondata①">(2)</a> <a href="#ref-for-dictdef-bluetoothpermissiondata②">(3)</a>
    <li><a href="#ref-for-dictdef-bluetoothpermissiondata③">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissiondata-alloweddevices">
   <b><a href="#dom-bluetoothpermissiondata-alloweddevices">#dom-bluetoothpermissiondata-alloweddevices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices">3. Device Discovery</a>
    <li><a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices①">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices②">(2)</a>
    <li><a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices③">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices④">(2)</a>
    <li><a href="#ref-for-dom-bluetoothpermissiondata-alloweddevices⑤">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-allowedbluetoothdevice-device-slot">
   <b><a href="#dom-allowedbluetoothdevice-device-slot">#dom-allowedbluetoothdevice-device-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-device-slot">3.1. Permission API Integration</a> <a href="#ref-for-dom-allowedbluetoothdevice-device-slot①">(2)</a> <a href="#ref-for-dom-allowedbluetoothdevice-device-slot②">(3)</a> <a href="#ref-for-dom-allowedbluetoothdevice-device-slot③">(4)</a>
    <li><a href="#ref-for-dom-allowedbluetoothdevice-device-slot④">4.2. BluetoothDevice</a> <a href="#ref-for-dom-allowedbluetoothdevice-device-slot⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothpermissionresult">
   <b><a href="#bluetoothpermissionresult">#bluetoothpermissionresult</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothpermissionresult">3.1. Permission API Integration</a> <a href="#ref-for-bluetoothpermissionresult①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothpermissionresult-devices">
   <b><a href="#dom-bluetoothpermissionresult-devices">#dom-bluetoothpermissionresult-devices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothpermissionresult-devices">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothpermissionresult-devices①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="revoke-bluetooth-access">
   <b><a href="#revoke-bluetooth-access">#revoke-bluetooth-access</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-revoke-bluetooth-access">2.1. Device access is powerful</a>
    <li><a href="#ref-for-revoke-bluetooth-access①">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetooth-getavailability">
   <b><a href="#dom-bluetooth-getavailability">#dom-bluetooth-getavailability</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetooth-getavailability">2.5. Exposing Bluetooth availability</a>
    <li><a href="#ref-for-dom-bluetooth-getavailability①">3. Device Discovery</a> <a href="#ref-for-dom-bluetooth-getavailability②">(2)</a>
    <li><a href="#ref-for-dom-bluetooth-getavailability③">3.2. Overall Bluetooth availability</a> <a href="#ref-for-dom-bluetooth-getavailability④">(2)</a> <a href="#ref-for-dom-bluetooth-getavailability⑤">(3)</a> <a href="#ref-for-dom-bluetooth-getavailability⑥">(4)</a> <a href="#ref-for-dom-bluetooth-getavailability⑦">(5)</a> <a href="#ref-for-dom-bluetooth-getavailability⑧">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valueevent">
   <b><a href="#valueevent">#valueevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valueevent">3.2. Overall Bluetooth availability</a> <a href="#ref-for-valueevent①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-valueeventinit">
   <b><a href="#dictdef-valueeventinit">#dictdef-valueeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-valueeventinit">3.2. Overall Bluetooth availability</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-valueevent-value">
   <b><a href="#dom-valueevent-value">#dom-valueevent-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-valueevent-value">3.2. Overall Bluetooth availability</a> <a href="#ref-for-dom-valueevent-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetooth-device">
   <b><a href="#bluetooth-device">#bluetooth-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetooth-device">3. Device Discovery</a> <a href="#ref-for-bluetooth-device①">(2)</a> <a href="#ref-for-bluetooth-device②">(3)</a> <a href="#ref-for-bluetooth-device③">(4)</a> <a href="#ref-for-bluetooth-device④">(5)</a> <a href="#ref-for-bluetooth-device⑤">(6)</a> <a href="#ref-for-bluetooth-device⑥">(7)</a> <a href="#ref-for-bluetooth-device⑦">(8)</a> <a href="#ref-for-bluetooth-device⑧">(9)</a>
    <li><a href="#ref-for-bluetooth-device⑨">3.1. Permission API Integration</a>
    <li><a href="#ref-for-bluetooth-device①⓪">4.1. Global Bluetooth device properties</a>
    <li><a href="#ref-for-bluetooth-device①①">4.2. BluetoothDevice</a> <a href="#ref-for-bluetooth-device①②">(2)</a> <a href="#ref-for-bluetooth-device①③">(3)</a>
    <li><a href="#ref-for-bluetooth-device①④">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-bluetooth-device①⑤">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-bluetooth-device①⑥">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="supported-physical-transports">
   <b><a href="#supported-physical-transports">#supported-physical-transports</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-supported-physical-transports">3. Device Discovery</a> <a href="#ref-for-supported-physical-transports①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="same-bluetooth-device">
   <b><a href="#same-bluetooth-device">#same-bluetooth-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-bluetooth-device">3.1. Permission API Integration</a>
    <li><a href="#ref-for-same-bluetooth-device①">4.2. BluetoothDevice</a> <a href="#ref-for-same-bluetooth-device②">(2)</a> <a href="#ref-for-same-bluetooth-device③">(3)</a> <a href="#ref-for-same-bluetooth-device④">(4)</a>
    <li><a href="#ref-for-same-bluetooth-device⑤">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-same-bluetooth-device⑥">5.1.4. Identifying Services, Characteristics, and Descriptors</a> <a href="#ref-for-same-bluetooth-device⑦">(2)</a>
    <li><a href="#ref-for-same-bluetooth-device⑧">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-same-bluetooth-device⑨">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothdevice">
   <b><a href="#bluetoothdevice">#bluetoothdevice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothdevice">3. Device Discovery</a> <a href="#ref-for-bluetoothdevice①">(2)</a> <a href="#ref-for-bluetoothdevice②">(3)</a> <a href="#ref-for-bluetoothdevice③">(4)</a> <a href="#ref-for-bluetoothdevice④">(5)</a> <a href="#ref-for-bluetoothdevice⑤">(6)</a>
    <li><a href="#ref-for-bluetoothdevice⑥">3.1. Permission API Integration</a> <a href="#ref-for-bluetoothdevice⑦">(2)</a> <a href="#ref-for-bluetoothdevice⑧">(3)</a> <a href="#ref-for-bluetoothdevice⑨">(4)</a>
    <li><a href="#ref-for-bluetoothdevice①⓪">4.2. BluetoothDevice</a> <a href="#ref-for-bluetoothdevice①①">(2)</a> <a href="#ref-for-bluetoothdevice①②">(3)</a> <a href="#ref-for-bluetoothdevice①③">(4)</a> <a href="#ref-for-bluetoothdevice①④">(5)</a> <a href="#ref-for-bluetoothdevice①⑤">(6)</a> <a href="#ref-for-bluetoothdevice①⑥">(7)</a> <a href="#ref-for-bluetoothdevice①⑦">(8)</a> <a href="#ref-for-bluetoothdevice①⑧">(9)</a> <a href="#ref-for-bluetoothdevice①⑨">(10)</a> <a href="#ref-for-bluetoothdevice②⓪">(11)</a>
    <li><a href="#ref-for-bluetoothdevice②①">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-bluetoothdevice②②">(2)</a> <a href="#ref-for-bluetoothdevice②③">(3)</a> <a href="#ref-for-bluetoothdevice②④">(4)</a> <a href="#ref-for-bluetoothdevice②⑤">(5)</a> <a href="#ref-for-bluetoothdevice②⑥">(6)</a>
    <li><a href="#ref-for-bluetoothdevice②⑦">5.1.2. The Bluetooth cache</a> <a href="#ref-for-bluetoothdevice②⑧">(2)</a>
    <li><a href="#ref-for-bluetoothdevice②⑨">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-bluetoothdevice③⓪">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-bluetoothdevice③①">(2)</a> <a href="#ref-for-bluetoothdevice③②">(3)</a>
    <li><a href="#ref-for-bluetoothdevice③③">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-bluetoothdevice③④">(2)</a>
    <li><a href="#ref-for-bluetoothdevice③⑤">5.6.1. Bluetooth Tree</a> <a href="#ref-for-bluetoothdevice③⑥">(2)</a> <a href="#ref-for-bluetoothdevice③⑦">(3)</a>
    <li><a href="#ref-for-bluetoothdevice③⑧">5.6.2. Event types</a> <a href="#ref-for-bluetoothdevice③⑨">(2)</a>
    <li><a href="#ref-for-bluetoothdevice④⓪">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-bluetoothdevice④①">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-id">
   <b><a href="#dom-bluetoothdevice-id">#dom-bluetoothdevice-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-id">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothdevice-id①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-id②">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-name">
   <b><a href="#dom-bluetoothdevice-name">#dom-bluetoothdevice-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-name">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-watchingadvertisements">
   <b><a href="#dom-bluetoothdevice-watchingadvertisements">#dom-bluetoothdevice-watchingadvertisements</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-watchingadvertisements">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetoothdevice-watchingadvertisements①">(2)</a> <a href="#ref-for-dom-bluetoothdevice-watchingadvertisements②">(3)</a> <a href="#ref-for-dom-bluetoothdevice-watchingadvertisements③">(4)</a> <a href="#ref-for-dom-bluetoothdevice-watchingadvertisements④">(5)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-watchingadvertisements⑤">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-dom-bluetoothdevice-watchingadvertisements⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-context-slot">
   <b><a href="#dom-bluetoothdevice-context-slot">#dom-bluetoothdevice-context-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-context-slot">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-dom-bluetoothdevice-context-slot①">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-dom-bluetoothdevice-context-slot②">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-representeddevice-slot">
   <b><a href="#dom-bluetoothdevice-representeddevice-slot">#dom-bluetoothdevice-representeddevice-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot">3.1. Permission API Integration</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot②">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot③">(2)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot④">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot⑤">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot⑥">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot⑦">(2)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot⑧">(3)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot⑨">(4)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①⓪">(5)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①①">(6)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①②">(7)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①③">5.6.3. Responding to Disconnection</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①④">(2)</a> <a href="#ref-for-dom-bluetoothdevice-representeddevice-slot①⑤">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-gatt-slot">
   <b><a href="#dom-bluetoothdevice-gatt-slot">#dom-bluetoothdevice-gatt-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-gatt-slot">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-allowedservices-slot">
   <b><a href="#dom-bluetoothdevice-allowedservices-slot">#dom-bluetoothdevice-allowedservices-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-allowedservices-slot">3.1. Permission API Integration</a>
    <li><a href="#ref-for-dom-bluetoothdevice-allowedservices-slot①">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-dom-bluetoothdevice-allowedservices-slot②">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot③">(2)</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot④">(3)</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot⑤">(4)</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot⑥">(5)</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot⑦">(6)</a>
    <li><a href="#ref-for-dom-bluetoothdevice-allowedservices-slot⑧">5.6.5. Responding to Service Changes</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot⑨">(2)</a> <a href="#ref-for-dom-bluetoothdevice-allowedservices-slot①⓪">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="get-the-bluetoothdevice-representing">
   <b><a href="#get-the-bluetoothdevice-representing">#get-the-bluetoothdevice-representing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-get-the-bluetoothdevice-representing">3. Device Discovery</a> <a href="#ref-for-get-the-bluetoothdevice-representing①">(2)</a>
    <li><a href="#ref-for-get-the-bluetoothdevice-representing②">3.1. Permission API Integration</a>
    <li><a href="#ref-for-get-the-bluetoothdevice-representing③">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-gatt">
   <b><a href="#dom-bluetoothdevice-gatt">#dom-bluetoothdevice-gatt</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-gatt">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetoothdevice-gatt①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-watchadvertisements">
   <b><a href="#dom-bluetoothdevice-watchadvertisements">#dom-bluetoothdevice-watchadvertisements</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-watchadvertisements">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdevice-unwatchadvertisements">
   <b><a href="#dom-bluetoothdevice-unwatchadvertisements">#dom-bluetoothdevice-unwatchadvertisements</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdevice-unwatchadvertisements">4.2. BluetoothDevice</a> <a href="#ref-for-dom-bluetoothdevice-unwatchadvertisements①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothadvertisingevent">
   <b><a href="#bluetoothadvertisingevent">#bluetoothadvertisingevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothadvertisingevent">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-bluetoothadvertisingevent①">(2)</a> <a href="#ref-for-bluetoothadvertisingevent②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-bluetoothadvertisingeventinit">
   <b><a href="#dictdef-bluetoothadvertisingeventinit">#dictdef-bluetoothadvertisingeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothadvertisingeventinit">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingeventinit-uuids">
   <b><a href="#dom-bluetoothadvertisingeventinit-uuids">#dom-bluetoothadvertisingeventinit-uuids</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingeventinit-uuids">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingeventinit-manufacturerdata">
   <b><a href="#dom-bluetoothadvertisingeventinit-manufacturerdata">#dom-bluetoothadvertisingeventinit-manufacturerdata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingeventinit-manufacturerdata">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingeventinit-servicedata">
   <b><a href="#dom-bluetoothadvertisingeventinit-servicedata">#dom-bluetoothadvertisingeventinit-servicedata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingeventinit-servicedata">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-device">
   <b><a href="#dom-bluetoothadvertisingevent-device">#dom-bluetoothadvertisingevent-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-device">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-dom-bluetoothadvertisingevent-device①">(2)</a> <a href="#ref-for-dom-bluetoothadvertisingevent-device②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-uuids">
   <b><a href="#dom-bluetoothadvertisingevent-uuids">#dom-bluetoothadvertisingevent-uuids</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-uuids">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-name">
   <b><a href="#dom-bluetoothadvertisingevent-name">#dom-bluetoothadvertisingevent-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-name">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-appearance">
   <b><a href="#dom-bluetoothadvertisingevent-appearance">#dom-bluetoothadvertisingevent-appearance</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-appearance">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-txpower">
   <b><a href="#dom-bluetoothadvertisingevent-txpower">#dom-bluetoothadvertisingevent-txpower</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-txpower">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-rssi">
   <b><a href="#dom-bluetoothadvertisingevent-rssi">#dom-bluetoothadvertisingevent-rssi</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-rssi">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-manufacturerdata">
   <b><a href="#dom-bluetoothadvertisingevent-manufacturerdata">#dom-bluetoothadvertisingevent-manufacturerdata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-manufacturerdata">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-servicedata">
   <b><a href="#dom-bluetoothadvertisingevent-servicedata">#dom-bluetoothadvertisingevent-servicedata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-servicedata">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fire-an-advertisementreceived-event">
   <b><a href="#fire-an-advertisementreceived-event">#fire-an-advertisementreceived-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-an-advertisementreceived-event">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothadvertisingevent-bluetoothadvertisingevent">
   <b><a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent">#dom-bluetoothadvertisingevent-bluetoothadvertisingevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothadvertisingevent-bluetoothadvertisingevent">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothmanufacturerdatamap">
   <b><a href="#bluetoothmanufacturerdatamap">#bluetoothmanufacturerdatamap</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothmanufacturerdatamap">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-bluetoothmanufacturerdatamap①">(2)</a> <a href="#ref-for-bluetoothmanufacturerdatamap②">(3)</a>
    <li><a href="#ref-for-bluetoothmanufacturerdatamap③">4.2.1.1. BluetoothManufacturerDataMap</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothmanufacturerdatamap-backingmap-slot">
   <b><a href="#dom-bluetoothmanufacturerdatamap-backingmap-slot">#dom-bluetoothmanufacturerdatamap-backingmap-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothmanufacturerdatamap-backingmap-slot">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothservicedatamap">
   <b><a href="#bluetoothservicedatamap">#bluetoothservicedatamap</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothservicedatamap">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-bluetoothservicedatamap①">(2)</a> <a href="#ref-for-bluetoothservicedatamap②">(3)</a>
    <li><a href="#ref-for-bluetoothservicedatamap③">4.2.1.2. BluetoothServiceDataMap</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothservicedatamap-backingmap-slot">
   <b><a href="#dom-bluetoothservicedatamap-backingmap-slot">#dom-bluetoothservicedatamap-backingmap-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothservicedatamap-backingmap-slot">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="attribute">
   <b><a href="#attribute">#attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-attribute">4.1. Global Bluetooth device properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetooth-cache">
   <b><a href="#bluetooth-cache">#bluetooth-cache</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetooth-cache">3. Device Discovery</a> <a href="#ref-for-bluetooth-cache①">(2)</a>
    <li><a href="#ref-for-bluetooth-cache②">5.1.2. The Bluetooth cache</a> <a href="#ref-for-bluetooth-cache③">(2)</a> <a href="#ref-for-bluetooth-cache④">(3)</a>
    <li><a href="#ref-for-bluetooth-cache⑤">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="populate-the-bluetooth-cache">
   <b><a href="#populate-the-bluetooth-cache">#populate-the-bluetooth-cache</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-populate-the-bluetooth-cache">3. Device Discovery</a> <a href="#ref-for-populate-the-bluetooth-cache①">(2)</a>
    <li><a href="#ref-for-populate-the-bluetooth-cache②">5.1.2. The Bluetooth cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="query-the-bluetooth-cache">
   <b><a href="#query-the-bluetooth-cache">#query-the-bluetooth-cache</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-query-the-bluetooth-cache">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-query-the-bluetooth-cache①">5.1.4. Identifying Services, Characteristics, and Descriptors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="represented">
   <b><a href="#represented">#represented</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-represented">5.1.3. Navigating the Bluetooth Hierarchy</a> <a href="#ref-for-represented①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="getgattchildren">
   <b><a href="#getgattchildren">#getgattchildren</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-getgattchildren">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-getgattchildren①">(2)</a>
    <li><a href="#ref-for-getgattchildren②">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-getgattchildren③">(2)</a> <a href="#ref-for-getgattchildren④">(3)</a> <a href="#ref-for-getgattchildren⑤">(4)</a>
    <li><a href="#ref-for-getgattchildren⑥">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-getgattchildren⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="same-attribute">
   <b><a href="#same-attribute">#same-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-attribute">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-same-attribute①">5.1.4. Identifying Services, Characteristics, and Descriptors</a> <a href="#ref-for-same-attribute②">(2)</a> <a href="#ref-for-same-attribute③">(3)</a>
    <li><a href="#ref-for-same-attribute④">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothremotegattserver">
   <b><a href="#bluetoothremotegattserver">#bluetoothremotegattserver</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothremotegattserver">4.2. BluetoothDevice</a> <a href="#ref-for-bluetoothremotegattserver①">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattserver②">5.1. GATT Information Model</a> <a href="#ref-for-bluetoothremotegattserver③">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattserver④">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-bluetoothremotegattserver⑤">(2)</a> <a href="#ref-for-bluetoothremotegattserver⑥">(3)</a> <a href="#ref-for-bluetoothremotegattserver⑦">(4)</a> <a href="#ref-for-bluetoothremotegattserver⑧">(5)</a> <a href="#ref-for-bluetoothremotegattserver⑨">(6)</a> <a href="#ref-for-bluetoothremotegattserver①⓪">(7)</a> <a href="#ref-for-bluetoothremotegattserver①①">(8)</a> <a href="#ref-for-bluetoothremotegattserver①②">(9)</a>
    <li><a href="#ref-for-bluetoothremotegattserver①③">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-device">
   <b><a href="#dom-bluetoothremotegattserver-device">#dom-bluetoothremotegattserver-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-device">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-device①">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-connected">
   <b><a href="#dom-bluetoothremotegattserver-connected">#dom-bluetoothremotegattserver-connected</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected①">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected②">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected③">(2)</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected④">(3)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected⑤">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected⑥">(2)</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected⑦">(3)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected⑧">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected⑨">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected①⓪">5.6.3. Responding to Disconnection</a> <a href="#ref-for-dom-bluetoothremotegattserver-connected①①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connected①②">5.6.4. Responding to Notifications and Indications</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-activealgorithms-slot">
   <b><a href="#dom-bluetoothremotegattserver-activealgorithms-slot">#dom-bluetoothremotegattserver-activealgorithms-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①">(2)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot②">(3)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot③">(4)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot④">(5)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑤">(6)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑥">(7)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑦">(8)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑧">(9)</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑨">(10)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①⓪">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①②">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①③">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①④">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-connect">
   <b><a href="#dom-bluetoothremotegattserver-connect">#dom-bluetoothremotegattserver-connect</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connect">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-connect①">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothremotegattserver-connect②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-disconnect">
   <b><a href="#dom-bluetoothremotegattserver-disconnect">#dom-bluetoothremotegattserver-disconnect</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-disconnect">3.1. Permission API Integration</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-disconnect①">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothremotegattserver-disconnect②">(2)</a> <a href="#ref-for-dom-bluetoothremotegattserver-disconnect③">(3)</a> <a href="#ref-for-dom-bluetoothremotegattserver-disconnect④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="garbage-collect-the-connection">
   <b><a href="#garbage-collect-the-connection">#garbage-collect-the-connection</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-garbage-collect-the-connection">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-garbage-collect-the-connection①">(2)</a> <a href="#ref-for-garbage-collect-the-connection②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="connection-checking-wrapper">
   <b><a href="#connection-checking-wrapper">#connection-checking-wrapper</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-connection-checking-wrapper">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-connection-checking-wrapper①">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-connection-checking-wrapper②">(2)</a>
    <li><a href="#ref-for-connection-checking-wrapper③">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-connection-checking-wrapper④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-getprimaryservice">
   <b><a href="#dom-bluetoothremotegattserver-getprimaryservice">#dom-bluetoothremotegattserver-getprimaryservice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-getprimaryservice">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-getprimaryservice①">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattserver-getprimaryservices">
   <b><a href="#dom-bluetoothremotegattserver-getprimaryservices">#dom-bluetoothremotegattserver-getprimaryservices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattserver-getprimaryservices">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothremotegattservice">
   <b><a href="#bluetoothremotegattservice">#bluetoothremotegattservice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothremotegattservice">3. Device Discovery</a>
    <li><a href="#ref-for-bluetoothremotegattservice①">5.1. GATT Information Model</a>
    <li><a href="#ref-for-bluetoothremotegattservice②">5.1.1. Persistence across connections</a>
    <li><a href="#ref-for-bluetoothremotegattservice③">5.1.2. The Bluetooth cache</a> <a href="#ref-for-bluetoothremotegattservice④">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattservice⑤">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-bluetoothremotegattservice⑥">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-bluetoothremotegattservice⑦">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattservice⑧">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-bluetoothremotegattservice⑨">(2)</a> <a href="#ref-for-bluetoothremotegattservice①⓪">(3)</a> <a href="#ref-for-bluetoothremotegattservice①①">(4)</a> <a href="#ref-for-bluetoothremotegattservice①②">(5)</a> <a href="#ref-for-bluetoothremotegattservice①③">(6)</a> <a href="#ref-for-bluetoothremotegattservice①④">(7)</a> <a href="#ref-for-bluetoothremotegattservice①⑤">(8)</a> <a href="#ref-for-bluetoothremotegattservice①⑥">(9)</a>
    <li><a href="#ref-for-bluetoothremotegattservice①⑦">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-bluetoothremotegattservice①⑧">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattservice①⑨">5.6.1. Bluetooth Tree</a> <a href="#ref-for-bluetoothremotegattservice②⓪">(2)</a> <a href="#ref-for-bluetoothremotegattservice②①">(3)</a>
    <li><a href="#ref-for-bluetoothremotegattservice②②">5.6.2. Event types</a> <a href="#ref-for-bluetoothremotegattservice②③">(2)</a> <a href="#ref-for-bluetoothremotegattservice②④">(3)</a>
    <li><a href="#ref-for-bluetoothremotegattservice②⑤">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-bluetoothremotegattservice②⑥">5.6.5. Responding to Service Changes</a> <a href="#ref-for-bluetoothremotegattservice②⑦">(2)</a> <a href="#ref-for-bluetoothremotegattservice②⑧">(3)</a> <a href="#ref-for-bluetoothremotegattservice②⑨">(4)</a> <a href="#ref-for-bluetoothremotegattservice③⓪">(5)</a> <a href="#ref-for-bluetoothremotegattservice③①">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-device">
   <b><a href="#dom-bluetoothremotegattservice-device">#dom-bluetoothremotegattservice-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-device">5.1.3. Navigating the Bluetooth Hierarchy</a> <a href="#ref-for-dom-bluetoothremotegattservice-device①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-device②">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-uuid">
   <b><a href="#dom-bluetoothremotegattservice-uuid">#dom-bluetoothremotegattservice-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-uuid">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-isprimary">
   <b><a href="#dom-bluetoothremotegattservice-isprimary">#dom-bluetoothremotegattservice-isprimary</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-isprimary">5.1. GATT Information Model</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-isprimary①">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-representedservice-slot">
   <b><a href="#dom-bluetoothremotegattservice-representedservice-slot">#dom-bluetoothremotegattservice-representedservice-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-representedservice-slot">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-representedservice-slot①">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-representedservice-slot②">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-representedservice-slot③">5.6.5. Responding to Service Changes</a> <a href="#ref-for-dom-bluetoothremotegattservice-representedservice-slot④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-bluetoothremotegattservice-representing">
   <b><a href="#create-a-bluetoothremotegattservice-representing">#create-a-bluetoothremotegattservice-representing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-bluetoothremotegattservice-representing">5.1.2. The Bluetooth cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-getcharacteristic">
   <b><a href="#dom-bluetoothremotegattservice-getcharacteristic">#dom-bluetoothremotegattservice-getcharacteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristic">1.1. Examples</a> <a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristic①">(2)</a> <a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristic②">(3)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristic③">5.1. GATT Information Model</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristic④">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-getcharacteristics">
   <b><a href="#dom-bluetoothremotegattservice-getcharacteristics">#dom-bluetoothremotegattservice-getcharacteristics</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getcharacteristics">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-getincludedservice">
   <b><a href="#dom-bluetoothremotegattservice-getincludedservice">#dom-bluetoothremotegattservice-getincludedservice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getincludedservice">5.1. GATT Information Model</a>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getincludedservice①">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattservice-getincludedservices">
   <b><a href="#dom-bluetoothremotegattservice-getincludedservices">#dom-bluetoothremotegattservice-getincludedservices</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattservice-getincludedservices">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothremotegattcharacteristic">
   <b><a href="#bluetoothremotegattcharacteristic">#bluetoothremotegattcharacteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic">1.1. Examples</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic①">3. Device Discovery</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②">5.1. GATT Information Model</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic③">5.1.1. Persistence across connections</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic④">5.1.2. The Bluetooth cache</a> <a href="#ref-for-bluetoothremotegattcharacteristic⑤">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic⑥">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic⑦">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-bluetoothremotegattcharacteristic⑧">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic⑨">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-bluetoothremotegattcharacteristic①⓪">(2)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①①">(3)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①②">(4)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①③">(5)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①④">(6)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①⑤">(7)</a> <a href="#ref-for-bluetoothremotegattcharacteristic①⑥">(8)</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic①⑦">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic①⑧">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-bluetoothremotegattcharacteristic①⑨">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②⓪">5.6.1. Bluetooth Tree</a> <a href="#ref-for-bluetoothremotegattcharacteristic②①">(2)</a> <a href="#ref-for-bluetoothremotegattcharacteristic②②">(3)</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②③">5.6.2. Event types</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②④">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②⑤">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-bluetoothremotegattcharacteristic②⑥">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-service">
   <b><a href="#dom-bluetoothremotegattcharacteristic-service">#dom-bluetoothremotegattcharacteristic-service</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-service">5.1.3. Navigating the Bluetooth Hierarchy</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-service①">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-uuid">
   <b><a href="#dom-bluetoothremotegattcharacteristic-uuid">#dom-bluetoothremotegattcharacteristic-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-uuid">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-properties">
   <b><a href="#dom-bluetoothremotegattcharacteristic-properties">#dom-bluetoothremotegattcharacteristic-properties</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-properties">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-value">
   <b><a href="#dom-bluetoothremotegattcharacteristic-value">#dom-bluetoothremotegattcharacteristic-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-value">1.1. Examples</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-value①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-value②">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">
   <b><a href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot①">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot②">(2)</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot③">(3)</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot④">(4)</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑤">(5)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑥">5.6.3. Responding to Disconnection</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑦">(2)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑧">5.6.5. Responding to Service Changes</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-bluetoothremotegattcharacteristic-representing">
   <b><a href="#create-a-bluetoothremotegattcharacteristic-representing">#create-a-bluetoothremotegattcharacteristic-representing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-bluetoothremotegattcharacteristic-representing">5.1.2. The Bluetooth cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-getdescriptor">
   <b><a href="#dom-bluetoothremotegattcharacteristic-getdescriptor">#dom-bluetoothremotegattcharacteristic-getdescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor">5.1. GATT Information Model</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor①">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-getdescriptors">
   <b><a href="#dom-bluetoothremotegattcharacteristic-getdescriptors">#dom-bluetoothremotegattcharacteristic-getdescriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-getdescriptors">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-readvalue">
   <b><a href="#dom-bluetoothremotegattcharacteristic-readvalue">#dom-bluetoothremotegattcharacteristic-readvalue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-readvalue">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-readvalue①">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-readvalue②">5.6.2. Event types</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="writecharacteristicvalue">
   <b><a href="#writecharacteristicvalue">#writecharacteristicvalue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-writecharacteristicvalue">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-writecharacteristicvalue①">(2)</a> <a href="#ref-for-writecharacteristicvalue②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-writevalue">
   <b><a href="#dom-bluetoothremotegattcharacteristic-writevalue">#dom-bluetoothremotegattcharacteristic-writevalue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-writevalue">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-writevalue①">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-writevaluewithresponse">
   <b><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse">#dom-bluetoothremotegattcharacteristic-writevaluewithresponse</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse">
   <b><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse">#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="active-notification-context-set">
   <b><a href="#active-notification-context-set">#active-notification-context-set</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-notification-context-set">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-active-notification-context-set①">(2)</a> <a href="#ref-for-active-notification-context-set②">(3)</a> <a href="#ref-for-active-notification-context-set③">(4)</a>
    <li><a href="#ref-for-active-notification-context-set④">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-active-notification-context-set⑤">5.6.4. Responding to Notifications and Indications</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-startnotifications">
   <b><a href="#dom-bluetoothremotegattcharacteristic-startnotifications">#dom-bluetoothremotegattcharacteristic-startnotifications</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-startnotifications">1.1. Examples</a>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-startnotifications①">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-startnotifications②">(2)</a> <a href="#ref-for-dom-bluetoothremotegattcharacteristic-startnotifications③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattcharacteristic-stopnotifications">
   <b><a href="#dom-bluetoothremotegattcharacteristic-stopnotifications">#dom-bluetoothremotegattcharacteristic-stopnotifications</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattcharacteristic-stopnotifications">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothcharacteristicproperties">
   <b><a href="#bluetoothcharacteristicproperties">#bluetoothcharacteristicproperties</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothcharacteristicproperties">5.1. GATT Information Model</a>
    <li><a href="#ref-for-bluetoothcharacteristicproperties①">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-bluetoothcharacteristicproperties②">5.4.1. BluetoothCharacteristicProperties</a> <a href="#ref-for-bluetoothcharacteristicproperties③">(2)</a> <a href="#ref-for-bluetoothcharacteristicproperties④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">
   <b><a href="#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothremotegattdescriptor">
   <b><a href="#bluetoothremotegattdescriptor">#bluetoothremotegattdescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothremotegattdescriptor">3. Device Discovery</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor①">5.1. GATT Information Model</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor②">5.1.1. Persistence across connections</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor③">5.1.2. The Bluetooth cache</a> <a href="#ref-for-bluetoothremotegattdescriptor④">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor⑤">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-bluetoothremotegattdescriptor⑥">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor⑦">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-bluetoothremotegattdescriptor⑧">(2)</a> <a href="#ref-for-bluetoothremotegattdescriptor⑨">(3)</a> <a href="#ref-for-bluetoothremotegattdescriptor①⓪">(4)</a> <a href="#ref-for-bluetoothremotegattdescriptor①①">(5)</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor①②">5.6.1. Bluetooth Tree</a> <a href="#ref-for-bluetoothremotegattdescriptor①③">(2)</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor①④">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-bluetoothremotegattdescriptor①⑤">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-characteristic">
   <b><a href="#dom-bluetoothremotegattdescriptor-characteristic">#dom-bluetoothremotegattdescriptor-characteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-characteristic">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-uuid">
   <b><a href="#dom-bluetoothremotegattdescriptor-uuid">#dom-bluetoothremotegattdescriptor-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-uuid">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-value">
   <b><a href="#dom-bluetoothremotegattdescriptor-value">#dom-bluetoothremotegattdescriptor-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-value">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-representeddescriptor-slot">
   <b><a href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot">#dom-bluetoothremotegattdescriptor-representeddescriptor-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot①">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot②">(2)</a> <a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot③">(3)</a>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot④">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑤">5.6.5. Responding to Service Changes</a> <a href="#ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-bluetoothremotegattdescriptor-representing">
   <b><a href="#create-a-bluetoothremotegattdescriptor-representing">#create-a-bluetoothremotegattdescriptor-representing</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-bluetoothremotegattdescriptor-representing">5.1.2. The Bluetooth cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-readvalue">
   <b><a href="#dom-bluetoothremotegattdescriptor-readvalue">#dom-bluetoothremotegattdescriptor-readvalue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-readvalue">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothremotegattdescriptor-writevalue">
   <b><a href="#dom-bluetoothremotegattdescriptor-writevalue">#dom-bluetoothremotegattdescriptor-writevalue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothremotegattdescriptor-writevalue">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetooth-tree">
   <b><a href="#bluetooth-tree">#bluetooth-tree</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetooth-tree">5.6.1. Bluetooth Tree</a>
    <li><a href="#ref-for-bluetooth-tree①">5.6.2. Event types</a> <a href="#ref-for-bluetooth-tree②">(2)</a>
    <li><a href="#ref-for-bluetooth-tree③">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-bluetooth-tree④">5.6.5. Responding to Service Changes</a> <a href="#ref-for-bluetooth-tree⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothdevice-advertisementreceived">
   <b><a href="#eventdef-bluetoothdevice-advertisementreceived">#eventdef-bluetoothdevice-advertisementreceived</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothdevice-advertisementreceived">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-eventdef-bluetoothdevice-advertisementreceived①">(2)</a> <a href="#ref-for-eventdef-bluetoothdevice-advertisementreceived②">(3)</a>
    <li><a href="#ref-for-eventdef-bluetoothdevice-advertisementreceived③">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetooth-availabilitychanged">
   <b><a href="#eventdef-bluetooth-availabilitychanged">#eventdef-bluetooth-availabilitychanged</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetooth-availabilitychanged">3. Device Discovery</a>
    <li><a href="#ref-for-eventdef-bluetooth-availabilitychanged①">3.2. Overall Bluetooth availability</a> <a href="#ref-for-eventdef-bluetooth-availabilitychanged②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged">
   <b><a href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged">#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged">1.1. Examples</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged①">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged②">5.6.4. Responding to Notifications and Indications</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged③">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothdevice-gattserverdisconnected">
   <b><a href="#eventdef-bluetoothdevice-gattserverdisconnected">#eventdef-bluetoothdevice-gattserverdisconnected</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothdevice-gattserverdisconnected">3.1. Permission API Integration</a>
    <li><a href="#ref-for-eventdef-bluetoothdevice-gattserverdisconnected①">5.6.3. Responding to Disconnection</a>
    <li><a href="#ref-for-eventdef-bluetoothdevice-gattserverdisconnected②">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothremotegattservice-serviceadded">
   <b><a href="#eventdef-bluetoothremotegattservice-serviceadded">#eventdef-bluetoothremotegattservice-serviceadded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-serviceadded">3. Device Discovery</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-serviceadded①">5.6.5. Responding to Service Changes</a> <a href="#ref-for-eventdef-bluetoothremotegattservice-serviceadded②">(2)</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-serviceadded③">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothremotegattservice-servicechanged">
   <b><a href="#eventdef-bluetoothremotegattservice-servicechanged">#eventdef-bluetoothremotegattservice-servicechanged</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-servicechanged">5.6.5. Responding to Service Changes</a> <a href="#ref-for-eventdef-bluetoothremotegattservice-servicechanged①">(2)</a> <a href="#ref-for-eventdef-bluetoothremotegattservice-servicechanged②">(3)</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-servicechanged③">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-bluetoothremotegattservice-serviceremoved">
   <b><a href="#eventdef-bluetoothremotegattservice-serviceremoved">#eventdef-bluetoothremotegattservice-serviceremoved</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-serviceremoved">5.6.5. Responding to Service Changes</a> <a href="#ref-for-eventdef-bluetoothremotegattservice-serviceremoved①">(2)</a>
    <li><a href="#ref-for-eventdef-bluetoothremotegattservice-serviceremoved②">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clean-up-the-disconnected-device">
   <b><a href="#clean-up-the-disconnected-device">#clean-up-the-disconnected-device</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clean-up-the-disconnected-device">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-clean-up-the-disconnected-device①">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristiceventhandlers">
   <b><a href="#characteristiceventhandlers">#characteristiceventhandlers</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristiceventhandlers">3. Device Discovery</a>
    <li><a href="#ref-for-characteristiceventhandlers①">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-characteristiceventhandlers②">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-characteristiceventhandlers③">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-characteristiceventhandlers-oncharacteristicvaluechanged">
   <b><a href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged">#dom-characteristiceventhandlers-oncharacteristicvaluechanged</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-characteristiceventhandlers-oncharacteristicvaluechanged">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetoothdeviceeventhandlers">
   <b><a href="#bluetoothdeviceeventhandlers">#bluetoothdeviceeventhandlers</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetoothdeviceeventhandlers">3. Device Discovery</a>
    <li><a href="#ref-for-bluetoothdeviceeventhandlers①">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdeviceeventhandlers-onadvertisementreceived">
   <b><a href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived">#dom-bluetoothdeviceeventhandlers-onadvertisementreceived</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdeviceeventhandlers-onadvertisementreceived">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothdeviceeventhandlers-ongattserverdisconnected">
   <b><a href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected">#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothdeviceeventhandlers-ongattserverdisconnected">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceeventhandlers">
   <b><a href="#serviceeventhandlers">#serviceeventhandlers</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceeventhandlers">3. Device Discovery</a>
    <li><a href="#ref-for-serviceeventhandlers①">4.2. BluetoothDevice</a>
    <li><a href="#ref-for-serviceeventhandlers②">5.3. BluetoothRemoteGATTService</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceeventhandlers-onserviceadded">
   <b><a href="#dom-serviceeventhandlers-onserviceadded">#dom-serviceeventhandlers-onserviceadded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceeventhandlers-onserviceadded">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceeventhandlers-onservicechanged">
   <b><a href="#dom-serviceeventhandlers-onservicechanged">#dom-serviceeventhandlers-onservicechanged</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceeventhandlers-onservicechanged">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceeventhandlers-onserviceremoved">
   <b><a href="#dom-serviceeventhandlers-onserviceremoved">#dom-serviceeventhandlers-onserviceremoved</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceeventhandlers-onserviceremoved">5.6.6. IDL event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedefdef-uuid">
   <b><a href="#typedefdef-uuid">#typedefdef-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-uuid">3.1. Permission API Integration</a>
    <li><a href="#ref-for-typedefdef-uuid①">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-typedefdef-uuid②">(2)</a> <a href="#ref-for-typedefdef-uuid③">(3)</a>
    <li><a href="#ref-for-typedefdef-uuid④">5.3. BluetoothRemoteGATTService</a>
    <li><a href="#ref-for-typedefdef-uuid⑤">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-typedefdef-uuid⑥">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-typedefdef-uuid⑦">6.1. Standardized UUIDs</a> <a href="#ref-for-typedefdef-uuid⑧">(2)</a> <a href="#ref-for-typedefdef-uuid⑨">(3)</a> <a href="#ref-for-typedefdef-uuid①⓪">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valid-uuid">
   <b><a href="#valid-uuid">#valid-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valid-uuid">6. UUIDs</a> <a href="#ref-for-valid-uuid①">(2)</a> <a href="#ref-for-valid-uuid②">(3)</a>
    <li><a href="#ref-for-valid-uuid③">6.1. Standardized UUIDs</a> <a href="#ref-for-valid-uuid④">(2)</a> <a href="#ref-for-valid-uuid⑤">(3)</a> <a href="#ref-for-valid-uuid⑥">(4)</a>
    <li><a href="#ref-for-valid-uuid⑦">7. The GATT Blocklist</a> <a href="#ref-for-valid-uuid⑧">(2)</a> <a href="#ref-for-valid-uuid⑨">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothuuid-canonicaluuid">
   <b><a href="#dom-bluetoothuuid-canonicaluuid">#dom-bluetoothuuid-canonicaluuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothuuid-canonicaluuid">6. UUIDs</a>
    <li><a href="#ref-for-dom-bluetoothuuid-canonicaluuid①">6.1. Standardized UUIDs</a> <a href="#ref-for-dom-bluetoothuuid-canonicaluuid②">(2)</a> <a href="#ref-for-dom-bluetoothuuid-canonicaluuid③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedefdef-bluetoothserviceuuid">
   <b><a href="#typedefdef-bluetoothserviceuuid">#typedefdef-bluetoothserviceuuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid">3. Device Discovery</a> <a href="#ref-for-typedefdef-bluetoothserviceuuid①">(2)</a> <a href="#ref-for-typedefdef-bluetoothserviceuuid②">(3)</a>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid③">3.1. Permission API Integration</a>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid④">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-typedefdef-bluetoothserviceuuid⑤">(2)</a>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid⑥">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-typedefdef-bluetoothserviceuuid⑦">(2)</a>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid⑧">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedefdef-bluetoothcharacteristicuuid">
   <b><a href="#typedefdef-bluetoothcharacteristicuuid">#typedefdef-bluetoothcharacteristicuuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-bluetoothcharacteristicuuid">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-typedefdef-bluetoothcharacteristicuuid①">(2)</a>
    <li><a href="#ref-for-typedefdef-bluetoothcharacteristicuuid②">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedefdef-bluetoothdescriptoruuid">
   <b><a href="#typedefdef-bluetoothdescriptoruuid">#typedefdef-bluetoothdescriptoruuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-bluetoothdescriptoruuid">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-typedefdef-bluetoothdescriptoruuid①">(2)</a>
    <li><a href="#ref-for-typedefdef-bluetoothdescriptoruuid②">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="resolveuuidname">
   <b><a href="#resolveuuidname">#resolveuuidname</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-resolveuuidname">6.1. Standardized UUIDs</a> <a href="#ref-for-resolveuuidname①">(2)</a> <a href="#ref-for-resolveuuidname②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothuuid-getservice">
   <b><a href="#dom-bluetoothuuid-getservice">#dom-bluetoothuuid-getservice</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice">3. Device Discovery</a> <a href="#ref-for-dom-bluetoothuuid-getservice①">(2)</a> <a href="#ref-for-dom-bluetoothuuid-getservice②">(3)</a> <a href="#ref-for-dom-bluetoothuuid-getservice③">(4)</a> <a href="#ref-for-dom-bluetoothuuid-getservice④">(5)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice⑤">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-dom-bluetoothuuid-getservice⑥">(2)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice⑦">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-dom-bluetoothuuid-getservice⑧">(2)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice⑨">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-dom-bluetoothuuid-getservice①⓪">(2)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice①①">6.1. Standardized UUIDs</a> <a href="#ref-for-dom-bluetoothuuid-getservice①②">(2)</a> <a href="#ref-for-dom-bluetoothuuid-getservice①③">(3)</a> <a href="#ref-for-dom-bluetoothuuid-getservice①④">(4)</a> <a href="#ref-for-dom-bluetoothuuid-getservice①⑤">(5)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getservice①⑥">9. Terminology and Conventions</a> <a href="#ref-for-dom-bluetoothuuid-getservice①⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothuuid-getcharacteristic">
   <b><a href="#dom-bluetoothuuid-getcharacteristic">#dom-bluetoothuuid-getcharacteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothuuid-getcharacteristic">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-dom-bluetoothuuid-getcharacteristic①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getcharacteristic②">6.1. Standardized UUIDs</a> <a href="#ref-for-dom-bluetoothuuid-getcharacteristic③">(2)</a> <a href="#ref-for-dom-bluetoothuuid-getcharacteristic④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-bluetoothuuid-getdescriptor">
   <b><a href="#dom-bluetoothuuid-getdescriptor">#dom-bluetoothuuid-getdescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-bluetoothuuid-getdescriptor">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-bluetoothuuid-getdescriptor①">(2)</a>
    <li><a href="#ref-for-dom-bluetoothuuid-getdescriptor②">6.1. Standardized UUIDs</a> <a href="#ref-for-dom-bluetoothuuid-getdescriptor③">(2)</a> <a href="#ref-for-dom-bluetoothuuid-getdescriptor④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="parsing-the-blocklist">
   <b><a href="#parsing-the-blocklist">#parsing-the-blocklist</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parsing-the-blocklist">7. The GATT Blocklist</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gatt-blocklist">
   <b><a href="#gatt-blocklist">#gatt-blocklist</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gatt-blocklist">2.3. Attacks on devices</a>
    <li><a href="#ref-for-gatt-blocklist①">7. The GATT Blocklist</a> <a href="#ref-for-gatt-blocklist②">(2)</a> <a href="#ref-for-gatt-blocklist③">(3)</a> <a href="#ref-for-gatt-blocklist④">(4)</a> <a href="#ref-for-gatt-blocklist⑤">(5)</a> <a href="#ref-for-gatt-blocklist⑥">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="blocklisted">
   <b><a href="#blocklisted">#blocklisted</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-blocklisted">3. Device Discovery</a> <a href="#ref-for-blocklisted①">(2)</a> <a href="#ref-for-blocklisted②">(3)</a>
    <li><a href="#ref-for-blocklisted③">5.1.3. Navigating the Bluetooth Hierarchy</a> <a href="#ref-for-blocklisted④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="blocklisted-for-reads">
   <b><a href="#blocklisted-for-reads">#blocklisted-for-reads</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-blocklisted-for-reads">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-blocklisted-for-reads①">(2)</a>
    <li><a href="#ref-for-blocklisted-for-reads②">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="blocklisted-for-writes">
   <b><a href="#blocklisted-for-writes">#blocklisted-for-writes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-blocklisted-for-writes">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-blocklisted-for-writes①">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-navigator-bluetooth">
   <b><a href="#dom-navigator-bluetooth">#dom-navigator-bluetooth</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-navigator-bluetooth">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-dom-navigator-bluetooth①">(2)</a> <a href="#ref-for-dom-navigator-bluetooth②">(3)</a> <a href="#ref-for-dom-navigator-bluetooth③">(4)</a>
    <li><a href="#ref-for-dom-navigator-bluetooth④">5.6.1. Bluetooth Tree</a> <a href="#ref-for-dom-navigator-bluetooth⑤">(2)</a> <a href="#ref-for-dom-navigator-bluetooth⑥">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-only-arraybuffer">
   <b><a href="#read-only-arraybuffer">#read-only-arraybuffer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-only-arraybuffer">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-read-only-arraybuffer①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="advertising-event">
   <b><a href="#advertising-event">#advertising-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-advertising-event">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-advertising-event①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extended-inquiry-response">
   <b><a href="#extended-inquiry-response">#extended-inquiry-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extended-inquiry-response">3. Device Discovery</a> <a href="#ref-for-extended-inquiry-response①">(2)</a>
    <li><a href="#ref-for-extended-inquiry-response②">4.1. Global Bluetooth device properties</a> <a href="#ref-for-extended-inquiry-response③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-bd_addr-command">
   <b><a href="#read-bd_addr-command">#read-bd_addr-command</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-bd_addr-command">2.4. Bluetooth device identifiers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="rssi">
   <b><a href="#rssi">#rssi</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-rssi">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="searching-for-services">
   <b><a href="#searching-for-services">#searching-for-services</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-searching-for-services">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="uuid">
   <b><a href="#uuid">#uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-uuid">3. Device Discovery</a>
    <li><a href="#ref-for-uuid①">4.2.1. Responding to Advertising Events</a>
    <li><a href="#ref-for-uuid②">5.1. GATT Information Model</a>
    <li><a href="#ref-for-uuid③">6. UUIDs</a> <a href="#ref-for-uuid④">(2)</a> <a href="#ref-for-uuid⑤">(3)</a> <a href="#ref-for-uuid⑥">(4)</a>
    <li><a href="#ref-for-uuid⑦">7. The GATT Blocklist</a> <a href="#ref-for-uuid⑧">(2)</a> <a href="#ref-for-uuid⑨">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="uuid-alias">
   <b><a href="#uuid-alias">#uuid-alias</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-uuid-alias">6. UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="the-128-bit-uuid-represented">
   <b><a href="#the-128-bit-uuid-represented">#the-128-bit-uuid-represented</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-the-128-bit-uuid-represented">6.1. Standardized UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="broadcaster">
   <b><a href="#broadcaster">#broadcaster</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-broadcaster">1. Introduction</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="observer">
   <b><a href="#observer">#observer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-observer">1. Introduction</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="peripheral">
   <b><a href="#peripheral">#peripheral</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-peripheral">1. Introduction</a> <a href="#ref-for-peripheral①">(2)</a> <a href="#ref-for-peripheral②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="central">
   <b><a href="#central">#central</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-central">1. Introduction</a> <a href="#ref-for-central①">(2)</a> <a href="#ref-for-central②">(3)</a>
    <li><a href="#ref-for-central③">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bluetooth-device-name">
   <b><a href="#bluetooth-device-name">#bluetooth-device-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bluetooth-device-name">2.4. Bluetooth device identifiers</a>
    <li><a href="#ref-for-bluetooth-device-name①">3. Device Discovery</a> <a href="#ref-for-bluetooth-device-name②">(2)</a> <a href="#ref-for-bluetooth-device-name③">(3)</a> <a href="#ref-for-bluetooth-device-name④">(4)</a> <a href="#ref-for-bluetooth-device-name⑤">(5)</a>
    <li><a href="#ref-for-bluetooth-device-name⑥">4.1. Global Bluetooth device properties</a> <a href="#ref-for-bluetooth-device-name⑦">(2)</a>
    <li><a href="#ref-for-bluetooth-device-name⑧">4.2. BluetoothDevice</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="device-discovery-procedure">
   <b><a href="#device-discovery-procedure">#device-discovery-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-device-discovery-procedure">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="br-edr-bonding-procedure">
   <b><a href="#br-edr-bonding-procedure">#br-edr-bonding-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-br-edr-bonding-procedure">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="observation-procedure">
   <b><a href="#observation-procedure">#observation-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-observation-procedure">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="general-discovery-procedure">
   <b><a href="#general-discovery-procedure">#general-discovery-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-general-discovery-procedure">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="name-discovery-procedure">
   <b><a href="#name-discovery-procedure">#name-discovery-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-name-discovery-procedure">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="le-bonding-procedure">
   <b><a href="#le-bonding-procedure">#le-bonding-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-le-bonding-procedure">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="privacy-feature">
   <b><a href="#privacy-feature">#privacy-feature</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-privacy-feature">2.4.2. The UA’s Bluetooth address</a> <a href="#ref-for-privacy-feature①">(2)</a> <a href="#ref-for-privacy-feature②">(3)</a>
    <li><a href="#ref-for-privacy-feature③">3. Device Discovery</a> <a href="#ref-for-privacy-feature④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="static-address">
   <b><a href="#static-address">#static-address</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-static-address">4.1. Global Bluetooth device properties</a> <a href="#ref-for-static-address①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="private-address">
   <b><a href="#private-address">#private-address</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-private-address">2.4. Bluetooth device identifiers</a>
    <li><a href="#ref-for-private-address①">4.1. Global Bluetooth device properties</a> <a href="#ref-for-private-address②">(2)</a> <a href="#ref-for-private-address③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="resolvable-private-address-resolution-procedure">
   <b><a href="#resolvable-private-address-resolution-procedure">#resolvable-private-address-resolution-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-resolvable-private-address-resolution-procedure">2.4. Bluetooth device identifiers</a>
    <li><a href="#ref-for-resolvable-private-address-resolution-procedure①">4.1. Global Bluetooth device properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="advertising-data">
   <b><a href="#advertising-data">#advertising-data</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-advertising-data">4.1. Global Bluetooth device properties</a> <a href="#ref-for-advertising-data①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="ad-structure">
   <b><a href="#ad-structure">#ad-structure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ad-structure">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bd_addr">
   <b><a href="#bd_addr">#bd_addr</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bd_addr">2.4. Bluetooth device identifiers</a> <a href="#ref-for-bd_addr①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="public-bluetooth-address">
   <b><a href="#public-bluetooth-address">#public-bluetooth-address</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-public-bluetooth-address">4.1. Global Bluetooth device properties</a> <a href="#ref-for-public-bluetooth-address①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="bond">
   <b><a href="#bond">#bond</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-bond">5.1.1. Persistence across connections</a> <a href="#ref-for-bond①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="attribute-type">
   <b><a href="#attribute-type">#attribute-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-attribute-type">6. UUIDs</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="attribute-handle">
   <b><a href="#attribute-handle">#attribute-handle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-attribute-handle">5.1. GATT Information Model</a> <a href="#ref-for-attribute-handle①">(2)</a> <a href="#ref-for-attribute-handle②">(3)</a>
    <li><a href="#ref-for-attribute-handle③">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-attribute-handle④">5.1.4. Identifying Services, Characteristics, and Descriptors</a> <a href="#ref-for-attribute-handle⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="long-attribute-values">
   <b><a href="#long-attribute-values">#long-attribute-values</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-long-attribute-values">5.4. BluetoothRemoteGATTCharacteristic</a>
    <li><a href="#ref-for-long-attribute-values①">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="error-response">
   <b><a href="#error-response">#error-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-error-response">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="generic-attribute-profile">
   <b><a href="#generic-attribute-profile">#generic-attribute-profile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-generic-attribute-profile">1. Introduction</a>
    <li><a href="#ref-for-generic-attribute-profile①">2.3. Attacks on devices</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gatt-client">
   <b><a href="#gatt-client">#gatt-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gatt-client">5.1. GATT Information Model</a> <a href="#ref-for-gatt-client①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gatt-server">
   <b><a href="#gatt-server">#gatt-server</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gatt-server">1. Introduction</a> <a href="#ref-for-gatt-server①">(2)</a>
    <li><a href="#ref-for-gatt-server②">5.1. GATT Information Model</a> <a href="#ref-for-gatt-server③">(2)</a>
    <li><a href="#ref-for-gatt-server④">5.2. BluetoothRemoteGATTServer</a>
    <li><a href="#ref-for-gatt-server⑤">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="profile-fundamentals">
   <b><a href="#profile-fundamentals">#profile-fundamentals</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-profile-fundamentals">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="att-bearer">
   <b><a href="#att-bearer">#att-bearer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-att-bearer">3. Device Discovery</a>
    <li><a href="#ref-for-att-bearer①">4.1. Global Bluetooth device properties</a> <a href="#ref-for-att-bearer②">(2)</a>
    <li><a href="#ref-for-att-bearer③">5.2. BluetoothRemoteGATTServer</a> <a href="#ref-for-att-bearer④">(2)</a> <a href="#ref-for-att-bearer⑤">(3)</a> <a href="#ref-for-att-bearer⑥">(4)</a>
    <li><a href="#ref-for-att-bearer⑦">5.6.3. Responding to Disconnection</a> <a href="#ref-for-att-bearer⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="attribute-caching">
   <b><a href="#attribute-caching">#attribute-caching</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-attribute-caching">5.1.1. Persistence across connections</a>
    <li><a href="#ref-for-attribute-caching①">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gatt-profile-hierarchy">
   <b><a href="#gatt-profile-hierarchy">#gatt-profile-hierarchy</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gatt-profile-hierarchy">5.1. GATT Information Model</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service">
   <b><a href="#service">#service</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service">1. Introduction</a>
    <li><a href="#ref-for-service①">3. Device Discovery</a> <a href="#ref-for-service②">(2)</a> <a href="#ref-for-service③">(3)</a> <a href="#ref-for-service④">(4)</a> <a href="#ref-for-service⑤">(5)</a>
    <li><a href="#ref-for-service⑥">5.1. GATT Information Model</a>
    <li><a href="#ref-for-service⑦">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-service⑧">(2)</a>
    <li><a href="#ref-for-service⑨">5.6.1. Bluetooth Tree</a>
    <li><a href="#ref-for-service①⓪">5.6.5. Responding to Service Changes</a> <a href="#ref-for-service①①">(2)</a> <a href="#ref-for-service①②">(3)</a> <a href="#ref-for-service①③">(4)</a> <a href="#ref-for-service①④">(5)</a> <a href="#ref-for-service①⑤">(6)</a> <a href="#ref-for-service①⑥">(7)</a> <a href="#ref-for-service①⑦">(8)</a> <a href="#ref-for-service①⑧">(9)</a> <a href="#ref-for-service①⑨">(10)</a> <a href="#ref-for-service②⓪">(11)</a> <a href="#ref-for-service②①">(12)</a> <a href="#ref-for-service②②">(13)</a> <a href="#ref-for-service②③">(14)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="included-service">
   <b><a href="#included-service">#included-service</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-included-service">5.1. GATT Information Model</a>
    <li><a href="#ref-for-included-service①">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-included-service②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic">
   <b><a href="#characteristic">#characteristic</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic">1. Introduction</a>
    <li><a href="#ref-for-characteristic①">2.3. Attacks on devices</a>
    <li><a href="#ref-for-characteristic②">5.1. GATT Information Model</a> <a href="#ref-for-characteristic③">(2)</a>
    <li><a href="#ref-for-characteristic④">5.3. BluetoothRemoteGATTService</a> <a href="#ref-for-characteristic⑤">(2)</a>
    <li><a href="#ref-for-characteristic⑥">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-characteristic⑦">(2)</a> <a href="#ref-for-characteristic⑧">(3)</a>
    <li><a href="#ref-for-characteristic⑨">5.5. BluetoothRemoteGATTDescriptor</a>
    <li><a href="#ref-for-characteristic①⓪">5.6.4. Responding to Notifications and Indications</a> <a href="#ref-for-characteristic①①">(2)</a>
    <li><a href="#ref-for-characteristic①②">5.6.5. Responding to Service Changes</a> <a href="#ref-for-characteristic①③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-interoperability-requirements">
   <b><a href="#service-interoperability-requirements">#service-interoperability-requirements</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-interoperability-requirements">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-definition">
   <b><a href="#service-definition">#service-definition</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-definition">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-properties">
   <b><a href="#characteristic-properties">#characteristic-properties</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-properties">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-characteristic-properties①">(2)</a> <a href="#ref-for-characteristic-properties②">(3)</a> <a href="#ref-for-characteristic-properties③">(4)</a> <a href="#ref-for-characteristic-properties④">(5)</a> <a href="#ref-for-characteristic-properties⑤">(6)</a>
    <li><a href="#ref-for-characteristic-properties⑥">5.4.1. BluetoothCharacteristicProperties</a> <a href="#ref-for-characteristic-properties⑦">(2)</a> <a href="#ref-for-characteristic-properties⑧">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="descriptor">
   <b><a href="#descriptor">#descriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-descriptor">1. Introduction</a>
    <li><a href="#ref-for-descriptor①">2.3. Attacks on devices</a>
    <li><a href="#ref-for-descriptor②">5.1. GATT Information Model</a>
    <li><a href="#ref-for-descriptor③">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-descriptor④">(2)</a>
    <li><a href="#ref-for-descriptor⑤">5.5. BluetoothRemoteGATTDescriptor</a> <a href="#ref-for-descriptor⑥">(2)</a>
    <li><a href="#ref-for-descriptor⑦">5.6.5. Responding to Service Changes</a> <a href="#ref-for-descriptor⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-extended-properties">
   <b><a href="#characteristic-extended-properties">#characteristic-extended-properties</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-extended-properties">5.4.1. BluetoothCharacteristicProperties</a> <a href="#ref-for-characteristic-extended-properties①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-characteristic-configuration">
   <b><a href="#client-characteristic-configuration">#client-characteristic-configuration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-characteristic-configuration">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-client-characteristic-configuration①">(2)</a> <a href="#ref-for-client-characteristic-configuration②">(3)</a> <a href="#ref-for-client-characteristic-configuration③">(4)</a> <a href="#ref-for-client-characteristic-configuration④">(5)</a>
    <li><a href="#ref-for-client-characteristic-configuration⑤">5.6.3. Responding to Disconnection</a> <a href="#ref-for-client-characteristic-configuration⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gatt-procedure">
   <b><a href="#gatt-procedure">#gatt-procedure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gatt-procedure">5.1. GATT Information Model</a>
    <li><a href="#ref-for-gatt-procedure①">5.1.2. The Bluetooth cache</a>
    <li><a href="#ref-for-gatt-procedure②">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="exchange-mtu">
   <b><a href="#exchange-mtu">#exchange-mtu</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exchange-mtu">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="primary-service-discovery">
   <b><a href="#primary-service-discovery">#primary-service-discovery</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-primary-service-discovery">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="discover-primary-service-by-service-uuid">
   <b><a href="#discover-primary-service-by-service-uuid">#discover-primary-service-by-service-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-discover-primary-service-by-service-uuid">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="relationship-discovery">
   <b><a href="#relationship-discovery">#relationship-discovery</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relationship-discovery">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-discovery">
   <b><a href="#characteristic-discovery">#characteristic-discovery</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-discovery">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="discover-characteristics-by-uuid">
   <b><a href="#discover-characteristics-by-uuid">#discover-characteristics-by-uuid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-discover-characteristics-by-uuid">5.1.2. The Bluetooth cache</a> <a href="#ref-for-discover-characteristics-by-uuid①">(2)</a>
    <li><a href="#ref-for-discover-characteristics-by-uuid②">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-descriptor-discovery">
   <b><a href="#characteristic-descriptor-discovery">#characteristic-descriptor-discovery</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-descriptor-discovery">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-characteristic-descriptor-discovery①">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="discover-all-characteristic-descriptors">
   <b><a href="#discover-all-characteristic-descriptors">#discover-all-characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-discover-all-characteristic-descriptors">5.6.1. Bluetooth Tree</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-value-read">
   <b><a href="#characteristic-value-read">#characteristic-value-read</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-value-read">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-value-write">
   <b><a href="#characteristic-value-write">#characteristic-value-write</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-value-write">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="write-without-response">
   <b><a href="#write-without-response">#write-without-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-write-without-response">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="write-characteristic-value">
   <b><a href="#write-characteristic-value">#write-characteristic-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-write-characteristic-value">5.4. BluetoothRemoteGATTCharacteristic</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-value-notification">
   <b><a href="#characteristic-value-notification">#characteristic-value-notification</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-value-notification">5.6.4. Responding to Notifications and Indications</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-value-indications">
   <b><a href="#characteristic-value-indications">#characteristic-value-indications</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-value-indications">5.6.4. Responding to Notifications and Indications</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="characteristic-descriptors">
   <b><a href="#characteristic-descriptors">#characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-characteristic-descriptors">5.4. BluetoothRemoteGATTCharacteristic</a> <a href="#ref-for-characteristic-descriptors①">(2)</a>
    <li><a href="#ref-for-characteristic-descriptors②">5.6.3. Responding to Disconnection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-characteristic-descriptors">
   <b><a href="#read-characteristic-descriptors">#read-characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-characteristic-descriptors">5.4.1. BluetoothCharacteristicProperties</a>
    <li><a href="#ref-for-read-characteristic-descriptors①">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="read-long-characteristic-descriptors">
   <b><a href="#read-long-characteristic-descriptors">#read-long-characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-read-long-characteristic-descriptors">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="write-characteristic-descriptors">
   <b><a href="#write-characteristic-descriptors">#write-characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-write-characteristic-descriptors">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="write-long-characteristic-descriptors">
   <b><a href="#write-long-characteristic-descriptors">#write-long-characteristic-descriptors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-write-long-characteristic-descriptors">5.5. BluetoothRemoteGATTDescriptor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="procedure-timeouts">
   <b><a href="#procedure-timeouts">#procedure-timeouts</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-procedure-timeouts">5.7. Error handling</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="gap-interoperability-requirements">
   <b><a href="#gap-interoperability-requirements">#gap-interoperability-requirements</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gap-interoperability-requirements">4.1. Global Bluetooth device properties</a>
    <li><a href="#ref-for-gap-interoperability-requirements①">5.2. BluetoothRemoteGATTServer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-changed">
   <b><a href="#service-changed">#service-changed</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-changed">5.6.2. Event types</a>
    <li><a href="#ref-for-service-changed①">5.6.5. Responding to Service Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="definition-of-keys-and-values">
   <b><a href="#definition-of-keys-and-values">#definition-of-keys-and-values</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-definition-of-keys-and-values">2.3. Attacks on devices</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="identity-resolving-key">
   <b><a href="#identity-resolving-key">#identity-resolving-key</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-identity-resolving-key">2.4. Bluetooth device identifiers</a> <a href="#ref-for-identity-resolving-key①">(2)</a>
    <li><a href="#ref-for-identity-resolving-key②">4.1. Global Bluetooth device properties</a> <a href="#ref-for-identity-resolving-key③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="public-device-address">
   <b><a href="#public-device-address">#public-device-address</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-public-device-address">2.4. Bluetooth device identifiers</a> <a href="#ref-for-public-device-address①">(2)</a> <a href="#ref-for-public-device-address②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="static-device-address">
   <b><a href="#static-device-address">#static-device-address</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-static-device-address">2.4. Bluetooth device identifiers</a> <a href="#ref-for-static-device-address①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="passive-scanning">
   <b><a href="#passive-scanning">#passive-scanning</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-passive-scanning">3. Device Discovery</a> <a href="#ref-for-passive-scanning①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-uuid-data-type">
   <b><a href="#service-uuid-data-type">#service-uuid-data-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-uuid-data-type">3. Device Discovery</a>
    <li><a href="#ref-for-service-uuid-data-type①">4.1. Global Bluetooth device properties</a>
    <li><a href="#ref-for-service-uuid-data-type②">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-service-uuid-data-type③">(2)</a> <a href="#ref-for-service-uuid-data-type④">(3)</a> <a href="#ref-for-service-uuid-data-type⑤">(4)</a> <a href="#ref-for-service-uuid-data-type⑥">(5)</a> <a href="#ref-for-service-uuid-data-type⑦">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="local-name-data-type">
   <b><a href="#local-name-data-type">#local-name-data-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-local-name-data-type">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-local-name-data-type①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="flags-data-type">
   <b><a href="#flags-data-type">#flags-data-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-flags-data-type">4.1. Global Bluetooth device properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="discoverable-mode">
   <b><a href="#discoverable-mode">#discoverable-mode</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-discoverable-mode">3. Device Discovery</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="manufacturer-specific-data">
   <b><a href="#manufacturer-specific-data">#manufacturer-specific-data</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-manufacturer-specific-data">3. Device Discovery</a> <a href="#ref-for-manufacturer-specific-data①">(2)</a> <a href="#ref-for-manufacturer-specific-data②">(3)</a>
    <li><a href="#ref-for-manufacturer-specific-data③">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="tx-power-level">
   <b><a href="#tx-power-level">#tx-power-level</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-tx-power-level">4.2.1. Responding to Advertising Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-data">
   <b><a href="#service-data">#service-data</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-data">3. Device Discovery</a> <a href="#ref-for-service-data①">(2)</a> <a href="#ref-for-service-data②">(3)</a>
    <li><a href="#ref-for-service-data③">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-service-data④">(2)</a> <a href="#ref-for-service-data⑤">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="appearance">
   <b><a href="#appearance">#appearance</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-appearance">4.2.1. Responding to Advertising Events</a> <a href="#ref-for-appearance①">(2)</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>